Use one space, not two, after trailing punctuation. fixes #19537

git-svn-id: https://develop.svn.wordpress.org/trunk@19593 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2011-12-13 23:45:31 +00:00
parent 10099bb8b7
commit 676ba7043e
88 changed files with 230 additions and 230 deletions
+1 -1
View File
@@ -680,7 +680,7 @@ function _admin_bar_bump_cb() { ?>
/**
* Set the display status of the admin bar.
*
* This can be called immediately upon plugin load. It does not need to be called from a function hooked to the init action.
* This can be called immediately upon plugin load. It does not need to be called from a function hooked to the init action.
*
* @since 3.1.0
*
+5 -5
View File
@@ -51,7 +51,7 @@ function wp_cache_close() {
* @see WP_Object_Cache::decr()
*
* @param int|string $key The cache key to increment
* @param int $offset The amount by which to decrement the item's value. Default is 1.
* @param int $offset The amount by which to decrement the item's value. Default is 1.
* @param string $group The group the key is in.
* @return false|int False on failure, the item's new value on success.
*/
@@ -120,7 +120,7 @@ function wp_cache_get( $key, $group = '', $force = false ) {
* @see WP_Object_Cache::incr()
*
* @param int|string $key The cache key to increment
* @param int $offset The amount by which to increment the item's value. Default is 1.
* @param int $offset The amount by which to increment the item's value. Default is 1.
* @param string $group The group the key is in.
* @return false|int False on failure, the item's new value on success.
*/
@@ -204,7 +204,7 @@ function wp_cache_add_non_persistent_groups( $groups ) {
}
/**
* Reset internal cache keys and structures. If the cache backend uses global blog or site IDs as part of its cache keys,
* Reset internal cache keys and structures. If the cache backend uses global blog or site IDs as part of its cache keys,
* this function instructs the backend to reset those keys and perform any cleanup since blog or site IDs have changed since cache init.
*
* @since 2.6.0
@@ -317,7 +317,7 @@ class WP_Object_Cache {
* @since 3.3.0
*
* @param int|string $key The cache key to increment
* @param int $offset The amount by which to decrement the item's value. Default is 1.
* @param int $offset The amount by which to decrement the item's value. Default is 1.
* @param string $group The group the key is in.
* @return false|int False on failure, the item's new value on success.
*/
@@ -416,7 +416,7 @@ class WP_Object_Cache {
* @since 3.3.0
*
* @param int|string $key The cache key to increment
* @param int $offset The amount by which to increment the item's value. Default is 1.
* @param int $offset The amount by which to increment the item's value. Default is 1.
* @param string $group The group the key is in.
* @return false|int False on failure, the item's new value on success.
*/
+1 -1
View File
@@ -1208,7 +1208,7 @@ function current_user_can_for_blog( $blog_id, $capability ) {
// Create new object to avoid stomping the global current_user.
$user = new WP_User( $current_user->ID) ;
// Set the blog id. @todo add blog id arg to WP_User constructor?
// Set the blog id. @todo add blog id arg to WP_User constructor?
$user->for_blog( $blog_id );
$args = array_slice( func_get_args(), 2 );
+2 -2
View File
@@ -201,7 +201,7 @@ class WP_Http {
* @param array $args Request arguments
* @param string $url URL to Request
*
* @return string|false Class name for the first transport that claims to support the request. False if no transport claims to support the request.
* @return string|false Class name for the first transport that claims to support the request. False if no transport claims to support the request.
*/
public function _get_first_available_transport( $args, $url = null ) {
$request_order = array( 'curl', 'streams', 'fsockopen' );
@@ -1031,7 +1031,7 @@ class WP_Http_Curl {
$ssl_verify = apply_filters('https_ssl_verify', $ssl_verify);
// CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since
// CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since
// a value of 0 will allow an unlimited timeout.
$timeout = (int) ceil( $r['timeout'] );
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
+4 -4
View File
@@ -156,7 +156,7 @@ class wp_xmlrpc_server extends IXR_Server {
*/
function login_pass_ok($user_login, $user_pass) {
if ( !get_option( 'enable_xmlrpc' ) ) {
$this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site. An admin user can enable them at %s'), admin_url('options-writing.php') ) );
$this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site. An admin user can enable them at %s'), admin_url('options-writing.php') ) );
return false;
}
@@ -178,7 +178,7 @@ class wp_xmlrpc_server extends IXR_Server {
*/
function login($username, $password) {
if ( !get_option( 'enable_xmlrpc' ) ) {
$this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site. An admin user can enable them at %s'), admin_url('options-writing.php') ) );
$this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site. An admin user can enable them at %s'), admin_url('options-writing.php') ) );
return false;
}
@@ -1945,7 +1945,7 @@ class wp_xmlrpc_server extends IXR_Server {
fclose($f);
/* so it is actually editable with a windows/mac client */
// FIXME: (or delete me) do we really want to cater to bad clients at the expense of good ones by BEEPing up their line breaks? commented. $content = str_replace("\n", "\r\n", $content);
// FIXME: (or delete me) do we really want to cater to bad clients at the expense of good ones by BEEPing up their line breaks? commented. $content = str_replace("\n", "\r\n", $content);
return $content;
}
@@ -2544,7 +2544,7 @@ class wp_xmlrpc_server extends IXR_Server {
$postdata = wp_get_single_post($post_ID, ARRAY_A);
// If there is no post data for the give post id, stop
// now and return an error. Other wise a new post will be
// now and return an error. Other wise a new post will be
// created (which was the old behavior).
if ( empty($postdata["ID"]) )
return(new IXR_Error(404, __('Invalid post ID.')));
+3 -3
View File
@@ -156,8 +156,8 @@ class WP {
$home_path = trim($home_path, '/');
// Trim path info from the end and the leading home path from the
// front. For path info requests, this leaves us with the requesting
// filename, if any. For 404 requests, this leaves us with the
// front. For path info requests, this leaves us with the requesting
// filename, if any. For 404 requests, this leaves us with the
// requested permalink.
$req_uri = str_replace($pathinfo, '', $req_uri);
$req_uri = trim($req_uri, '/');
@@ -401,7 +401,7 @@ class WP {
}
}
// query_string filter deprecated. Use request filter instead.
// query_string filter deprecated. Use request filter instead.
if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in.
$this->query_string = apply_filters('query_string', $this->query_string);
parse_str($this->query_string, $this->query_vars);
+4 -4
View File
@@ -28,7 +28,7 @@ class WP_Dependencies {
/**
* Do the dependencies
*
* Process the items passed to it or the queue. Processes all dependencies.
* Process the items passed to it or the queue. Processes all dependencies.
*
* @param mixed $handles (optional) items to be processed. (void) processes queue, (string) process that item, (array of strings) process those items
* @return array Items that have been processed
@@ -63,7 +63,7 @@ class WP_Dependencies {
/**
* Determines dependencies
*
* Recursively builds array of items to process taking dependencies into account. Does NOT catch infinite loops.
* Recursively builds array of items to process taking dependencies into account. Does NOT catch infinite loops.
*
*
* @param mixed $handles Accepts (string) dep name or (array of strings) dep names
@@ -90,7 +90,7 @@ class WP_Dependencies {
if ( !isset($this->registered[$handle]) )
$keep_going = false; // Script doesn't exist
elseif ( $this->registered[$handle]->deps && array_diff($this->registered[$handle]->deps, array_keys($this->registered)) )
$keep_going = false; // Script requires deps which don't exist (not a necessary check. efficiency?)
$keep_going = false; // Script requires deps which don't exist (not a necessary check. efficiency?)
elseif ( $this->registered[$handle]->deps && !$this->all_deps( $this->registered[$handle]->deps, true, $group ) )
$keep_going = false; // Script requires deps which don't exist
@@ -98,7 +98,7 @@ class WP_Dependencies {
if ( $recursion )
return false; // Abort this branch.
else
continue; // We're at the top level. Move on to the next one.
continue; // We're at the top level. Move on to the next one.
}
if ( $queued ) // Already grobbed it and its deps
+2 -2
View File
@@ -37,9 +37,9 @@ class WP_Scripts extends WP_Dependencies {
/**
* Prints scripts
*
* Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
* Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
*
* @param mixed $handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
* @param mixed $handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
* @param int $group (optional) If scripts were queued in groups prints this group number.
* @return array Scripts that have been printed
*/
+9 -9
View File
@@ -55,7 +55,7 @@ function comment_author( $comment_ID = 0 ) {
* @uses apply_filters() Calls the 'get_comment_author_email' hook on the comment author email
* @uses $comment
*
* @param int $comment_ID The ID of the comment for which to get the author's email. Optional.
* @param int $comment_ID The ID of the comment for which to get the author's email. Optional.
* @return string The current comment author's email
*/
function get_comment_author_email( $comment_ID = 0 ) {
@@ -141,7 +141,7 @@ function get_comment_author_email_link($linktext='', $before='', $after='') {
* @since 1.5.0
* @uses apply_filters() Calls 'get_comment_author_link' hook on the complete link HTML or author
*
* @param int $comment_ID The ID of the comment for which to get the author's link. Optional.
* @param int $comment_ID The ID of the comment for which to get the author's link. Optional.
* @return string Comment Author name or HTML link for author's URL
*/
function get_comment_author_link( $comment_ID = 0 ) {
@@ -189,7 +189,7 @@ function get_comment_author_IP( $comment_ID = 0 ) {
* @since 0.71
* @see get_comment_author_IP() Echoes Result
*
* @param int $comment_ID The ID of the comment for which to print the author's IP address. Optional.
* @param int $comment_ID The ID of the comment for which to print the author's IP address. Optional.
*/
function comment_author_IP( $comment_ID = 0 ) {
echo get_comment_author_IP( $comment_ID );
@@ -201,7 +201,7 @@ function comment_author_IP( $comment_ID = 0 ) {
* @since 1.5.0
* @uses apply_filters() Calls 'get_comment_author_url' hook on the comment author's URL
*
* @param int $comment_ID The ID of the comment for which to get the author's URL. Optional.
* @param int $comment_ID The ID of the comment for which to get the author's URL. Optional.
* @return string
*/
function get_comment_author_url( $comment_ID = 0 ) {
@@ -384,7 +384,7 @@ function get_comment_date( $d = '', $comment_ID = 0 ) {
* @since 0.71
*
* @param string $d The format of the date (defaults to user's config)
* @param int $comment_ID The ID of the comment for which to print the date. Optional.
* @param int $comment_ID The ID of the comment for which to print the date. Optional.
*/
function comment_date( $d = '', $comment_ID = 0 ) {
echo get_comment_date( $d, $comment_ID );
@@ -912,7 +912,7 @@ function comments_template( $file = '/comments.php', $separate_comments = false
if ( file_exists( $include ) )
require( $include );
elseif ( file_exists( TEMPLATEPATH . $file ) )
require( TEMPLATEPATH . $file );
require( TEMPLATEPATH . $file );
else // Backward compat code will be removed in a future release
require( ABSPATH . WPINC . '/theme-compat/comments.php');
}
@@ -1091,7 +1091,7 @@ function comment_reply_link($args = array(), $comment = null, $post = null) {
* @since 2.7.0
*
* @param array $args Optional. Override default options.
* @param int|object $post Optional. Post that the comment is going to be displayed on. Defaults to current post.
* @param int|object $post Optional. Post that the comment is going to be displayed on. Defaults to current post.
* @return string|bool|null Link to show comment form, if successful. False, if comments are closed.
*/
function get_post_reply_link($args = array(), $post = null) {
@@ -1408,7 +1408,7 @@ class Walker_Comment extends Walker {
* @uses Walker_Comment
*
* @param string|array $args Formatting options
* @param array $comments Optional array of comment objects. Defaults to $wp_query->comments
* @param array $comments Optional array of comment objects. Defaults to $wp_query->comments
*/
function wp_list_comments($args = array(), $comments = null ) {
global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop;
@@ -1534,7 +1534,7 @@ function comment_form( $args = array(), $post_id = null ) {
$defaults = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
'comment_notes_after' => '<p class="form-allowed-tags">' . sprintf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ), ' <code>' . allowed_tags() . '</code>' ) . '</p>',
+5 -5
View File
@@ -685,9 +685,9 @@ function check_comment_flood_db( $ip, $email, $date ) {
do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment);
if ( defined('DOING_AJAX') )
die( __('You are posting comments too quickly. Slow down.') );
die( __('You are posting comments too quickly. Slow down.') );
wp_die( __('You are posting comments too quickly. Slow down.'), '', array('response' => 403) );
wp_die( __('You are posting comments too quickly. Slow down.'), '', array('response' => 403) );
}
}
}
@@ -723,7 +723,7 @@ function &separate_comments(&$comments) {
* @uses get_option() Used to fill in defaults for parameters.
* @uses Walker_Comment
*
* @param array $comments Optional array of comment objects. Defaults to $wp_query->comments
* @param array $comments Optional array of comment objects. Defaults to $wp_query->comments
* @param int $per_page Optional comments per page.
* @param boolean $threaded Optional control over flat or threaded comments.
* @return int Number of comment pages.
@@ -1947,7 +1947,7 @@ function update_comment_cache($comments) {
//
/**
* Close comments on old posts on the fly, without any extra DB queries. Hooked to the_posts.
* Close comments on old posts on the fly, without any extra DB queries. Hooked to the_posts.
*
* @access private
* @since 2.7.0
@@ -1977,7 +1977,7 @@ function _close_comments_for_old_posts( $posts, $query ) {
}
/**
* Close comments on an old post. Hooked to comments_open and pings_open.
* Close comments on an old post. Hooked to comments_open and pings_open.
*
* @access private
* @since 2.7.0
+1 -1
View File
@@ -47,7 +47,7 @@ function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
* specific interval, specified by you. The action will trigger when someone
* visits your WordPress site, if the scheduled time has passed.
*
* Valid values for the recurrence are hourly, daily and twicedaily. These can
* Valid values for the recurrence are hourly, daily and twicedaily. These can
* be extended using the cron_schedules filter in wp_get_schedules().
*
* Use wp_next_scheduled() to prevent duplicates
+2 -2
View File
@@ -105,7 +105,7 @@ function wp_plugin_directory_constants( ) {
* @deprecated
*/
if ( !defined('PLUGINDIR') )
define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
/**
* Allows for the mu-plugins directory to be moved from the default location.
@@ -130,7 +130,7 @@ function wp_plugin_directory_constants( ) {
* @deprecated
*/
if ( !defined( 'MUPLUGINDIR' ) )
define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat.
define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat.
}
/**
+1 -1
View File
@@ -732,7 +732,7 @@ function sanitize_file_name( $filename ) {
$extension = array_pop($parts);
$mimes = get_allowed_mime_types();
// Loop over any intermediate extensions. Munge them with a trailing underscore if they are a 2 - 5 character
// Loop over any intermediate extensions. Munge them with a trailing underscore if they are a 2 - 5 character
// long alpha string not in the extension whitelist.
foreach ( (array) $parts as $part) {
$filename .= '.' . $part;
+4 -4
View File
@@ -1905,7 +1905,7 @@ function is_blog_installed() {
$suppress = $wpdb->suppress_errors();
// Loop over the WP tables. If none exist, then scratch install is allowed.
// Loop over the WP tables. If none exist, then scratch install is allowed.
// If one or more exist, suggest table repair since we got here because the options
// table could not be accessed.
$wp_tables = $wpdb->tables();
@@ -1922,7 +1922,7 @@ function is_blog_installed() {
// One or more tables exist. We are insane.
// Die with a DB error.
$wpdb->error = sprintf( /*WP_I18N_NO_TABLES*/'One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'/*/WP_I18N_NO_TABLES*/, 'maint/repair.php?referrer=is_blog_installed' );
$wpdb->error = sprintf( /*WP_I18N_NO_TABLES*/'One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'/*/WP_I18N_NO_TABLES*/, 'maint/repair.php?referrer=is_blog_installed' );
dead_db();
}
@@ -3785,8 +3785,8 @@ function wp_suspend_cache_addition( $suspend = null ) {
/**
* Suspend cache invalidation.
*
* Turns cache invalidation on and off. Useful during imports where you don't wont to do invalidations
* every time a post is inserted. Callers must be sure that what they are doing won't lead to an inconsistent
* Turns cache invalidation on and off. Useful during imports where you don't wont to do invalidations
* every time a post is inserted. Callers must be sure that what they are doing won't lead to an inconsistent
* cache when invalidation is suspended.
*
* @since 2.7.0
+2 -2
View File
@@ -2080,7 +2080,7 @@ function wp_admin_css_uri( $file = 'wp-admin' ) {
*
* @param string $file Optional. Style handle name or file name (without ".css" extension) relative
* to wp-admin/. Defaults to 'wp-admin'.
* @param bool $force_echo Optional. Force the stylesheet link to be printed rather than enqueued.
* @param bool $force_echo Optional. Force the stylesheet link to be printed rather than enqueued.
*/
function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
global $wp_styles;
@@ -2091,7 +2091,7 @@ function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
$handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file;
if ( $wp_styles->query( $handle ) ) {
if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue. Print this one immediately
if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue. Print this one immediately
wp_print_styles( $handle );
else // Add to style queue
wp_enqueue_style( $handle );
+1 -1
View File
@@ -197,7 +197,7 @@ function wp_remote_retrieve_body(&$response) {
* @since 3.2.0
*
* @param array $capabilities Array of capabilities to test or a wp_remote_request() $args array.
* @param string $url Optional. If given, will check if the URL requires SSL and adds that requirement to the capabilities array.
* @param string $url Optional. If given, will check if the URL requires SSL and adds that requirement to the capabilities array.
*
* @return bool
*/
+1 -1
View File
@@ -229,7 +229,7 @@ function autosave_enable_buttons() {
function autosave_disable_buttons() {
jQuery(':button, :submit', '#submitpost').prop('disabled', true);
// Re-enable 5 sec later. Just gives autosave a head start to avoid collisions.
// Re-enable 5 sec later. Just gives autosave a head start to avoid collisions.
setTimeout(autosave_enable_buttons, 5000);
}
+2 -2
View File
@@ -10,7 +10,7 @@
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
@@ -718,7 +718,7 @@ function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols) {
* input. It will add quotes around attribute values that don't have any quotes
* or apostrophes around them, to make it easier to produce HTML code that will
* conform to W3C's HTML specification. It will also remove bad URL protocols
* from attribute values. It also reduces duplicate attributes by using the
* from attribute values. It also reduces duplicate attributes by using the
* attribute defined first (foo='bar' foo='baz' will result in foo='bar').
*
* @since 1.0.0
+2 -2
View File
@@ -507,7 +507,7 @@ function get_post_comments_feed_link($post_id = 0, $feed = '') {
* @since 2.5.0
*
* @param string $link_text Descriptive text.
* @param int $post_id Optional post ID. Default to current post.
* @param int $post_id Optional post ID. Default to current post.
* @param string $feed Optional. Feed format.
* @return string Link to the comment feed for the current post.
*/
@@ -2187,7 +2187,7 @@ function self_admin_url($path = '', $scheme = 'admin') {
/**
* Get the URL to the user's dashboard.
*
* If a user does not belong to any site, the global user dashboard is used. If the user belongs to the current site,
* If a user does not belong to any site, the global user dashboard is used. If the user belongs to the current site,
* the dashboard for the current site is returned. If the user cannot edit the current site, the dashboard to the user's
* primary blog is returned.
*
+1 -1
View File
@@ -568,7 +568,7 @@ function shutdown_action_hook() {
*/
function wp_clone( $object ) {
// Use parens for clone to accommodate PHP 4. See #17880
// Use parens for clone to accommodate PHP 4. See #17880
return clone( $object );
}
+1 -1
View File
@@ -113,7 +113,7 @@ class WP_Locale {
$this->weekday[5] = /* translators: weekday */ __('Friday');
$this->weekday[6] = /* translators: weekday */ __('Saturday');
// The first letter of each day. The _%day%_initial suffix is a hack to make
// The first letter of each day. The _%day%_initial suffix is a hack to make
// sure the day initials are unique.
$this->weekday_initial[__('Sunday')] = /* translators: one-letter abbreviation of the weekday */ __('S_Sunday_initial');
$this->weekday_initial[__('Monday')] = /* translators: one-letter abbreviation of the weekday */ __('M_Monday_initial');
+2 -2
View File
@@ -53,9 +53,9 @@ function image_constrain_size_for_editor($width, $height, $size = 'medium') {
// if no width is set, default to the theme content width if available
}
elseif ( $size == 'large' ) {
// we're inserting a large size image into the editor. if it's a really
// We're inserting a large size image into the editor. If it's a really
// big image we'll scale it down to fit reasonably within the editor
// itself, and within the theme's content width if it's known. the user
// itself, and within the theme's content width if it's known. The user
// can resize it in the editor if they wish.
$max_width = intval(get_option('large_size_w'));
$max_height = intval(get_option('large_size_h'));
+14 -14
View File
@@ -2,8 +2,8 @@
/**
* Metadata API
*
* Functions for retrieving and manipulating metadata of various WordPress object types. Metadata
* for an object is a represented by a simple key-value pair. Objects may contain multiple
* Functions for retrieving and manipulating metadata of various WordPress object types. Metadata
* for an object is a represented by a simple key-value pair. Objects may contain multiple
* metadata entries that share the same key and differ only in their value.
*
* @package WordPress
@@ -23,8 +23,8 @@
* @param int $object_id ID of the object metadata is for
* @param string $meta_key Metadata key
* @param string $meta_value Metadata value
* @param bool $unique Optional, default is false. Whether the specified metadata key should be
* unique for the object. If true, and the object already has a value for the specified
* @param bool $unique Optional, default is false. Whether the specified metadata key should be
* unique for the object. If true, and the object already has a value for the specified
* metadata key, no change will be made
* @return bool The meta ID on successful update, false on failure.
*/
@@ -80,7 +80,7 @@ function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique =
}
/**
* Update metadata for the specified object. If no value already exists for the specified object
* Update metadata for the specified object. If no value already exists for the specified object
* ID and metadata key, the metadata will be added.
*
* @since 2.9.0
@@ -94,8 +94,8 @@ function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique =
* @param int $object_id ID of the object metadata is for
* @param string $meta_key Metadata key
* @param string $meta_value Metadata value
* @param string $prev_value Optional. If specified, only update existing metadata entries with
* the specified value. Otherwise, update all entries.
* @param string $prev_value Optional. If specified, only update existing metadata entries with
* the specified value. Otherwise, update all entries.
* @return bool True on successful update, false on failure.
*/
function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '') {
@@ -174,10 +174,10 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v
* @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
* @param int $object_id ID of the object metadata is for
* @param string $meta_key Metadata key
* @param string $meta_value Optional. Metadata value. If specified, only delete metadata entries
* with this value. Otherwise, delete all entries with the specified meta_key.
* @param bool $delete_all Optional, default is false. If true, delete matching metadata entries
* for all objects, ignoring the specified object_id. Otherwise, only delete matching
* @param string $meta_value Optional. Metadata value. If specified, only delete metadata entries
* with this value. Otherwise, delete all entries with the specified meta_key.
* @param bool $delete_all Optional, default is false. If true, delete matching metadata entries
* for all objects, ignoring the specified object_id. Otherwise, only delete matching
* metadata entries for the specified object_id.
* @return bool True on successful delete, false on failure.
*/
@@ -256,10 +256,10 @@ function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $d
*
* @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
* @param int $object_id ID of the object metadata is for
* @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
* @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for
* the specified object.
* @param bool $single Optional, default is false. If true, return only the first value of the
* specified meta_key. This parameter has no effect if meta_key is not specified.
* @param bool $single Optional, default is false. If true, return only the first value of the
* specified meta_key. This parameter has no effect if meta_key is not specified.
* @return string|array Single metadata value, or array of values
*/
function get_metadata($meta_type, $object_id, $meta_key = '', $single = false) {
+1 -1
View File
@@ -880,7 +880,7 @@ function wpmu_activate_signup($key) {
// TODO: What to do if we create a user but cannot create a blog?
if ( is_wp_error($blog_id) ) {
// If blog is taken, that means a previous attempt to activate this blog failed in between creating the blog and
// setting the activation flag. Let's just set the active flag and instruct the user to reset their password.
// setting the activation flag. Let's just set the active flag and instruct the user to reset their password.
if ( 'blog_taken' == $blog_id->get_error_code() ) {
$blog_id->add_data( $signup );
$wpdb->update( $wpdb->signups, array( 'active' => 1, 'activated' => $now ), array( 'activation_key' => $key ) );
+3 -3
View File
@@ -113,7 +113,7 @@ class Walker_Nav_Menu extends Walker {
*
* Optional $args contents:
*
* menu - The menu that is desired. Accepts (matching in order) id, slug, name. Defaults to blank.
* menu - The menu that is desired. Accepts (matching in order) id, slug, name. Defaults to blank.
* menu_class - CSS class to use for the ul element which forms the menu. Defaults to 'menu'.
* menu_id - The ID that is applied to the ul element which forms the menu. Defaults to the menu slug, incremented.
* container - Whether to wrap the ul, and what to wrap it with. Defaults to 'div'.
@@ -125,9 +125,9 @@ class Walker_Nav_Menu extends Walker {
* link_before - Text before the link.
* link_after - Text after the link.
* echo - Whether to echo the menu or return it. Defaults to echo.
* depth - how many levels of the hierarchy are to be included. 0 means all. Defaults to 0.
* depth - how many levels of the hierarchy are to be included. 0 means all. Defaults to 0.
* walker - allows a custom walker to be specified.
* theme_location - the location in the theme to be used. Must be registered with register_nav_menu() in order to be selectable by the user.
* theme_location - the location in the theme to be used. Must be registered with register_nav_menu() in order to be selectable by the user.
* items_wrap - How the list items should be wrapped. Defaults to a ul with an id and class. Uses printf() format with numbered placeholders.
*
* @since 3.0.0
+1 -1
View File
@@ -554,7 +554,7 @@ function wp_get_nav_menu_items( $menu, $args = array() ) {
* - object: The type of object originally represented, such as "category," "post", or "attachment."
* - type_label: The singular label used to describe this type of menu item.
* - post_parent: The DB ID of the original object's parent object, if any (0 otherwise).
* - menu_item_parent: The DB ID of the nav_menu_item that is this item's menu parent, if any. 0 otherwise.
* - menu_item_parent: The DB ID of the nav_menu_item that is this item's menu parent, if any. 0 otherwise.
* - url: The URL to which this menu item points.
* - title: The title of this menu item.
* - target: The target attribute of the link element for this menu item.
+2 -2
View File
@@ -111,8 +111,8 @@ if ( !function_exists('get_user_by') ) :
*
* @since 2.8.0
*
* @param string $field The field to retrieve the user with. id | slug | email | login
* @param int|string $value A value for $field. A user ID, slug, email address, or login name.
* @param string $field The field to retrieve the user with. id | slug | email | login
* @param int|string $value A value for $field. A user ID, slug, email address, or login name.
* @return bool|object False on failure, WP_User object on success
*/
function get_user_by( $field, $value ) {
+3 -3
View File
@@ -80,7 +80,7 @@ function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1)
* @global array $wp_filter Stores all of the filters
*
* @param string $tag The name of the filter hook.
* @param callback $function_to_check optional. If specified, return the priority of that function on this hook or false if not attached.
* @param callback $function_to_check optional. If specified, return the priority of that function on this hook or false if not attached.
* @return int|boolean Optionally returns the priority on that hook for the specified function.
*/
function has_filter($tag, $function_to_check = false) {
@@ -499,7 +499,7 @@ function do_action_ref_array($tag, $args) {
* @see has_filter() has_action() is an alias of has_filter().
*
* @param string $tag The name of the action hook.
* @param callback $function_to_check optional. If specified, return the priority of that function on this hook or false if not attached.
* @param callback $function_to_check optional. If specified, return the priority of that function on this hook or false if not attached.
* @return int|boolean Optionally returns the priority on that hook for the specified function.
*/
function has_action($tag, $function_to_check = false) {
@@ -744,7 +744,7 @@ function _wp_call_all_hook($args) {
* @global array $wp_filter Storage for all of the filters and actions
* @param string $tag Used in counting how many hooks were applied
* @param callback $function Used for creating unique id
* @param int|bool $priority Used in counting how many hooks were applied. If === false and $function is an object reference, we return the unique id only if it already has one, false otherwise.
* @param int|bool $priority Used in counting how many hooks were applied. If === false and $function is an object reference, we return the unique id only if it already has one, false otherwise.
* @return string|bool Unique ID for usage as array key or false if $priority === false and $function is an object reference, and it does not already have a unique id.
*/
function _wp_filter_build_unique_id($tag, $function, $priority) {
+2 -2
View File
@@ -555,7 +555,7 @@ function get_body_class( $class = '' ) {
*
* @since 2.7.0
*
* @param int|object $post An optional post. Global $post used if not provided.
* @param int|object $post An optional post. Global $post used if not provided.
* @return bool false if a password is not required or the correct password cookie is present, true otherwise.
*/
function post_password_required( $post = null ) {
@@ -1307,7 +1307,7 @@ function wp_post_revision_title( $revision, $link = true ) {
*
* Second argument controls parameters:
* (bool) parent : include the parent (the "Current Revision") in the list.
* (string) format : 'list' or 'form-table'. 'list' outputs UL, 'form-table'
* (string) format : 'list' or 'form-table'. 'list' outputs UL, 'form-table'
* outputs TABLE with UI.
* (int) right : what revision is currently being viewed - used in
* form-table format.
+2 -2
View File
@@ -39,7 +39,7 @@ function get_post_thumbnail_id( $post_id = null ) {
*
* @since 2.9.0
*
* @param int $size Optional. Image size. Defaults to 'post-thumbnail', which theme sets using set_post_thumbnail_size( $width, $height, $crop_flag );.
* @param int $size Optional. Image size. Defaults to 'post-thumbnail', which theme sets using set_post_thumbnail_size( $width, $height, $crop_flag );.
* @param string|array $attr Optional. Query string or array of attributes.
*/
function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
@@ -82,7 +82,7 @@ function update_post_thumbnail_cache() {
* @since 2.9.0
*
* @param int $post_id Optional. Post ID.
* @param string $size Optional. Image size. Defaults to 'thumbnail'.
* @param string $size Optional. Image size. Defaults to 'thumbnail'.
* @param string|array $attr Optional. Query string or array of attributes.
*/
function get_the_post_thumbnail( $post_id = null, $size = 'post-thumbnail', $attr = '' ) {
+11 -11
View File
@@ -493,7 +493,7 @@ function get_post_mime_type($ID = '') {
*
* @param int|object $post A post
*
* @return mixed The format if successful. False if no format is set. WP_Error if errors.
* @return mixed The format if successful. False if no format is set. WP_Error if errors.
*/
function get_post_format( $post = null ) {
$post = get_post($post);
@@ -531,7 +531,7 @@ function has_post_format( $format, $post = null ) {
* @since 3.1.0
*
* @param int|object $post The post for which to assign a format
* @param string $format A format to assign. Use an empty string or array to remove all formats from the post.
* @param string $format A format to assign. Use an empty string or array to remove all formats from the post.
* @return mixed WP_Error on error. Array of affected term IDs on success.
*/
function set_post_format( $post, $format ) {
@@ -887,7 +887,7 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
* - supports - An alias for calling add_post_type_support() directly. See {@link add_post_type_support()}
* for documentation. Defaults to none.
* - register_meta_box_cb - Provide a callback function that will be called when setting up the
* meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback.
* meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback.
* - taxonomies - An array of taxonomy identifiers that will be registered for the post type.
* Default is no taxonomies. Taxonomies can be registered later with register_taxonomy() or
* register_taxonomy_for_object_type().
@@ -952,7 +952,7 @@ function register_post_type($post_type, $args = array()) {
if ( null === $args->show_in_admin_bar )
$args->show_in_admin_bar = true === $args->show_in_menu;
// Whether to show this type in nav-menus.php. Defaults to the setting for public.
// Whether to show this type in nav-menus.php. Defaults to the setting for public.
if ( null === $args->show_in_nav_menus )
$args->show_in_nav_menus = $args->public;
@@ -2005,9 +2005,9 @@ function wp_delete_post( $postid = 0, $force_delete = false ) {
unstick_post($postid);
}
// Do raw query. wp_get_post_revisions() is filtered
// Do raw query. wp_get_post_revisions() is filtered
$revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $postid ) );
// Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up.
// Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up.
foreach ( $revision_ids as $revision_id )
wp_delete_post_revision( $revision_id );
@@ -2482,7 +2482,7 @@ function wp_insert_post($postarr, $wp_error = false) {
if ( 'pending' == $post_status && !current_user_can( 'publish_posts' ) )
$post_name = '';
// Create a valid post name. Drafts and pending posts are allowed to have an empty
// Create a valid post name. Drafts and pending posts are allowed to have an empty
// post name.
if ( empty($post_name) ) {
if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) )
@@ -4150,8 +4150,8 @@ function get_private_posts_cap_sql( $post_type ) {
*
* @since 3.0.0
* @param string $post_type Post type.
* @param bool $full Optional. Returns a full WHERE statement instead of just an 'andalso' term.
* @param int $post_author Optional. Query posts having a single author ID.
* @param bool $full Optional. Returns a full WHERE statement instead of just an 'andalso' term.
* @param int $post_author Optional. Query posts having a single author ID.
* @return string SQL WHERE code that can be added to a query.
*/
function get_posts_by_author_sql( $post_type, $full = true, $post_author = null ) {
@@ -4902,7 +4902,7 @@ function _wp_put_post_revision( $post = null, $autosave = false ) {
*
* @param int|object $post Post ID or post object
* @param string $output Optional. OBJECT, ARRAY_A, or ARRAY_N.
* @param string $filter Optional sanitation filter. @see sanitize_post()
* @param string $filter Optional sanitation filter. @see sanitize_post()
* @return mixed Null if error or post object if success
*/
function &wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') {
@@ -5110,7 +5110,7 @@ function wp_check_post_hierarchy_for_loops( $post_parent, $post_ID ) {
if ( isset( $loop[$post_ID] ) )
return 0;
// There's a loop, but it doesn't contain $post_ID. Break the loop.
// There's a loop, but it doesn't contain $post_ID. Break the loop.
foreach ( array_keys( $loop ) as $loop_member )
wp_update_post( array( 'ID' => $loop_member, 'post_parent' => 0 ) );
+12 -12
View File
@@ -29,7 +29,7 @@ function get_query_var($var) {
/**
* Retrieve the currently-queried object. Wrapper for $wp_query->get_queried_object()
* Retrieve the currently-queried object. Wrapper for $wp_query->get_queried_object()
*
* @uses WP_Query::get_queried_object
*
@@ -728,7 +728,7 @@ function is_main_query() {
}
/*
* The Loop. Post loop control.
* The Loop. Post loop control.
*/
/**
@@ -1261,7 +1261,7 @@ class WP_Query {
var $query_vars_hash = false;
/**
* Whether query vars have changed since the initial parse_query() call. Used to catch modifications to query vars made
* Whether query vars have changed since the initial parse_query() call. Used to catch modifications to query vars made
* via pre_get_posts hooks.
*
* @since 3.1.1
@@ -1454,7 +1454,7 @@ class WP_Query {
if ( '' !== $qv['minute'] ) $qv['minute'] = absint($qv['minute']);
if ( '' !== $qv['second'] ) $qv['second'] = absint($qv['second']);
// Compat. Map subpost to attachment.
// Compat. Map subpost to attachment.
if ( '' != $qv['subpost'] )
$qv['attachment'] = $qv['subpost'];
if ( '' != $qv['subpost_id'] )
@@ -1477,7 +1477,7 @@ class WP_Query {
$this->is_page = true;
$this->is_single = false;
} else {
// Look for archive queries. Dates, categories, authors, search, post type archives.
// Look for archive queries. Dates, categories, authors, search, post type archives.
if ( !empty($qv['s']) ) {
$this->is_search = true;
@@ -2449,13 +2449,13 @@ class WP_Query {
}
if ( !empty($r_status) ) {
if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can($edit_others_cap) )
$statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $r_status ) . "))";
$statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $r_status ) . "))";
else
$statuswheres[] = "(" . join( ' OR ', $r_status ) . ")";
}
if ( !empty($p_status) ) {
if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can($read_private_cap) )
$statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $p_status ) . "))";
$statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $p_status ) . "))";
else
$statuswheres[] = "(" . join( ' OR ', $p_status ) . ")";
}
@@ -2564,7 +2564,7 @@ class WP_Query {
$pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
// Apply post-paging filters on where and join. Only plugins that
// Apply post-paging filters on where and join. Only plugins that
// manipulate paging queries should use these hooks.
if ( !$q['suppress_filters'] ) {
$where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) );
@@ -2581,10 +2581,10 @@ class WP_Query {
$$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
}
// Announce current selection parameters. For use by caching plugins.
// Announce current selection parameters. For use by caching plugins.
do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join );
// Filter again for the benefit of caching plugins. Regular plugins should use the hooks above.
// Filter again for the benefit of caching plugins. Regular plugins should use the hooks above.
if ( !$q['suppress_filters'] ) {
$where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) );
$groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) );
@@ -2631,7 +2631,7 @@ class WP_Query {
$this->posts = $wpdb->get_results($this->request);
// Raw results filter. Prior to status checks.
// Raw results filter. Prior to status checks.
if ( !$q['suppress_filters'] )
$this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) );
@@ -2700,7 +2700,7 @@ class WP_Query {
array_splice($this->posts, $i, 1);
// Move to front, after other stickies
array_splice($this->posts, $sticky_offset, 0, array($sticky_post));
// Increment the sticky offset. The next sticky will be placed at this offset.
// Increment the sticky offset. The next sticky will be placed at this offset.
$sticky_offset++;
// Remove post from sticky posts array
$offset = array_search($sticky_post->ID, $sticky_posts);
+2 -2
View File
@@ -1189,11 +1189,11 @@ class WP_Rewrite {
$feedregex2 = '';
foreach ( (array) $this->feeds as $feed_name)
$feedregex2 .= $feed_name . '|';
$feedregex2 = '(' . trim($feedregex2, '|') . ')/?$';
$feedregex2 = '(' . trim($feedregex2, '|') . ')/?$';
//$feedregex is identical but with /feed/ added on as well, so URLs like <permalink>/feed/atom
//and <permalink>/atom are both possible
$feedregex = $this->feed_base . '/' . $feedregex2;
$feedregex = $this->feed_base . '/' . $feedregex2;
//build a regex to match the trackback and page/xx parts of URLs
$trackbackregex = 'trackback/?$';
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/**
* Deprecated. Use rss.php instead.
* Deprecated. Use rss.php instead.
*
* @package WordPress
*/
+13 -13
View File
@@ -1083,19 +1083,19 @@ function get_term_to_edit( $id, $taxonomy ) {
* hide_empty - Default is true. Will not return empty terms, which means
* terms whose count is 0 according to the given taxonomy.
*
* exclude - Default is an empty array. An array, comma- or space-delimited string
* of term ids to exclude from the return array. If 'include' is non-empty,
* exclude - Default is an empty array. An array, comma- or space-delimited string
* of term ids to exclude from the return array. If 'include' is non-empty,
* 'exclude' is ignored.
*
* exclude_tree - Default is an empty array. An array, comma- or space-delimited
* exclude_tree - Default is an empty array. An array, comma- or space-delimited
* string of term ids to exclude from the return array, along with all of their
* descendant terms according to the primary taxonomy. If 'include' is non-empty,
* descendant terms according to the primary taxonomy. If 'include' is non-empty,
* 'exclude_tree' is ignored.
*
* include - Default is an empty array. An array, comma- or space-delimited string
* include - Default is an empty array. An array, comma- or space-delimited string
* of term ids to include in the return array.
*
* number - The maximum number of terms to return. Default is to return them all.
* number - The maximum number of terms to return. Default is to return them all.
*
* offset - The number by which to offset the terms query.
*
@@ -1109,7 +1109,7 @@ function get_term_to_edit( $id, $taxonomy ) {
* (even if 'hide_empty' is set to true).
*
* search - Returned terms' names will contain the value of 'search',
* case-insensitive. Default is an empty string.
* case-insensitive. Default is an empty string.
*
* name__like - Returned terms' names will begin with the value of 'name__like',
* case-insensitive. Default is empty string.
@@ -1120,13 +1120,13 @@ function get_term_to_edit( $id, $taxonomy ) {
* The 'get' argument, if set to 'all' instead of its default empty string,
* returns terms regardless of ancestry or whether the terms are empty.
*
* The 'child_of' argument, when used, should be set to the integer of a term ID. Its default
* is 0. If set to a non-zero value, all returned terms will be descendants
* of that term according to the given taxonomy. Hence 'child_of' is set to 0
* The 'child_of' argument, when used, should be set to the integer of a term ID. Its default
* is 0. If set to a non-zero value, all returned terms will be descendants
* of that term according to the given taxonomy. Hence 'child_of' is set to 0
* if more than one taxonomy is passed in $taxonomies, because multiple taxonomies
* make term ancestry ambiguous.
*
* The 'parent' argument, when used, should be set to the integer of a term ID. Its default is
* The 'parent' argument, when used, should be set to the integer of a term ID. Its default is
* the empty string '', which has a different meaning from the integer 0.
* If set to an integer value, all returned terms will have as an immediate
* ancestor the term whose ID is specified by that integer according to the given taxonomy.
@@ -3094,7 +3094,7 @@ function get_post_taxonomies($post = 0) {
*
* @param int $object_id ID of the object (post ID, link ID, ...)
* @param string $taxonomy Single taxonomy name
* @param int|string|array $terms Optional. Term term_id, name, slug or array of said
* @param int|string|array $terms Optional. Term term_id, name, slug or array of said
* @return bool|WP_Error. WP_Error on input error.
*/
function is_object_in_term( $object_id, $taxonomy, $terms = null ) {
@@ -3240,7 +3240,7 @@ function wp_check_term_hierarchy_for_loops( $parent, $term_id, $taxonomy ) {
if ( isset( $loop[$term_id] ) )
return 0;
// There's a loop, but it doesn't contain $term_id. Break the loop.
// There's a loop, but it doesn't contain $term_id. Break the loop.
foreach ( array_keys( $loop ) as $loop_member )
wp_update_term( $loop_member, $taxonomy, array( 'parent' => 0 ) );
+4 -4
View File
@@ -393,9 +393,9 @@ function get_themes() {
if ( empty($stylesheet_dir) )
$stylesheet_dir = '/';
// Check for theme name collision. This occurs if a theme is copied to
// a new theme directory and the theme header is not updated. Whichever
// theme is first keeps the name. Subsequent themes get a suffix applied.
// Check for theme name collision. This occurs if a theme is copied to
// a new theme directory and the theme header is not updated. Whichever
// theme is first keeps the name. Subsequent themes get a suffix applied.
// The Twenty Eleven, Twenty Ten, Default and Classic themes always trump
// their pretenders.
if ( isset($wp_themes[$name]) ) {
@@ -1942,7 +1942,7 @@ function current_theme_supports( $feature ) {
switch ( $feature ) {
case 'post-thumbnails':
// post-thumbnails can be registered for only certain content/post types by passing
// an array of types to add_theme_support(). If no array was passed, then
// an array of types to add_theme_support(). If no array was passed, then
// any type is accepted
if ( true === $_wp_theme_features[$feature] ) // Registered for all types
return true;
+2 -2
View File
@@ -828,7 +828,7 @@ function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '') {
* Count number of users who have each of the user roles.
*
* Assumes there are neither duplicated nor orphaned capabilities meta_values.
* Assumes role names are unique phrases. Same assumption made by WP_User_Query::prepare_query()
* Assumes role names are unique phrases. Same assumption made by WP_User_Query::prepare_query()
* Using $strategy = 'time' this is CPU-intensive and should handle around 10^7 users.
* Using $strategy = 'memory' this is memory-intensive and should handle around 10^5 users, but see WP Bug #12257.
*
@@ -973,7 +973,7 @@ function setup_userdata($for_user_id = '') {
* <li>id - Default is the value of the 'name' parameter. ID attribute of select element.</li>
* <li>class - Class attribute of select element.</li>
* <li>blog_id - ID of blog (Multisite only). Defaults to ID of current blog.</li>
* <li>who - Which users to query. Currently only 'authors' is supported. Default is all users.</li>
* <li>who - Which users to query. Currently only 'authors' is supported. Default is all users.</li>
* </ol>
*
* @since 2.3.0
+5 -5
View File
@@ -1191,7 +1191,7 @@ class wpdb {
* @see wp_set_wpdb_vars()
*
* @param string $table table name
* @param array $data Data to insert (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped).
* @param array $data Data to insert (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped).
* @param array|string $format Optional. An array of formats to be mapped to each of the value in $data. If string, that format will be used for all of the values in $data.
* A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
* @param string $type Optional. What type of operation is this? INSERT or REPLACE. Defaults to INSERT.
@@ -1234,7 +1234,7 @@ class wpdb {
* @param array $where A named array of WHERE clauses (in column => value pairs). Multiple clauses will be joined with ANDs. Both $where columns and $where values should be "raw".
* @param array|string $format Optional. An array of formats to be mapped to each of the values in $data. If string, that format will be used for all of the values in $data.
* A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
* @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where. If string, that format will be used for all of the items in $where. A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $where will be treated as strings.
* @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where. If string, that format will be used for all of the items in $where. A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $where will be treated as strings.
* @return int|false The number of rows updated, or false on error.
*/
function update( $table, $data, $where, $format = null, $where_format = null ) {
@@ -1278,8 +1278,8 @@ class wpdb {
* @since 0.71
*
* @param string|null $query Optional. SQL query. Defaults to null, use the result from the previous query.
* @param int $x Optional. Column of value to return. Indexed from 0.
* @param int $y Optional. Row of value to return. Indexed from 0.
* @param int $x Optional. Column of value to return. Indexed from 0.
* @param int $y Optional. Row of value to return. Indexed from 0.
* @return string|null Database query result (as string), or null on failure
*/
function get_var( $query = null, $x = 0, $y = 0 ) {
@@ -1365,7 +1365,7 @@ class wpdb {
* @param string $query SQL query.
* @param string $output Optional. Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants. With one of the first three, return an array of rows indexed from 0 by SQL result row number.
* Each row is an associative array (column => value, ...), a numerically indexed array (0 => value, ...), or an object. ( ->column = value ), respectively.
* With OBJECT_K, return an associative array of row objects keyed by the value of each row's first column's value. Duplicate keys are discarded.
* With OBJECT_K, return an associative array of row objects keyed by the value of each row's first column's value. Duplicate keys are discarded.
* @return mixed Database query results
*/
function get_results( $query = null, $output = OBJECT ) {
+12 -12
View File
@@ -202,9 +202,9 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
$r = '';
// Does the aforementioned additional processing
// *_matches tell what rows are "the same" in orig and final. Those pairs will be diffed to get word changes
// *_matches tell what rows are "the same" in orig and final. Those pairs will be diffed to get word changes
// match is numeric: an index in other column
// match is 'X': no match. It is a new row
// match is 'X': no match. It is a new row
// *_rows are column vectors for the orig column and the final column.
// row >= 0: an indix of the $orig or $final array
// row < 0: a blank row for that column
@@ -231,7 +231,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
$stripped_diff = strlen(strip_tags( $diff )) * 2 - $stripped_matches;
$diff_ratio = $stripped_matches / $stripped_diff;
if ( $diff_ratio > $this->_diff_threshold )
continue; // Too different. Don't save diffs.
continue; // Too different. Don't save diffs.
}
// Un-inline the diffs by removing del or ins
@@ -241,11 +241,11 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
}
foreach ( array_keys($orig_rows) as $row ) {
// Both columns have blanks. Ignore them.
// Both columns have blanks. Ignore them.
if ( $orig_rows[$row] < 0 && $final_rows[$row] < 0 )
continue;
// If we have a word based diff, use it. Otherwise, use the normal line.
// If we have a word based diff, use it. Otherwise, use the normal line.
if ( isset( $orig_diffs[$orig_rows[$row]] ) )
$orig_line = $orig_diffs[$orig_rows[$row]];
elseif ( isset( $orig[$orig_rows[$row]] ) )
@@ -260,9 +260,9 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
else
$final_line = '';
if ( $orig_rows[$row] < 0 ) { // Orig is blank. This is really an added row.
if ( $orig_rows[$row] < 0 ) { // Orig is blank. This is really an added row.
$r .= $this->_added( array($final_line), false );
} elseif ( $final_rows[$row] < 0 ) { // Final is blank. This is really a deleted row.
} elseif ( $final_rows[$row] < 0 ) { // Final is blank. This is really a deleted row.
$r .= $this->_deleted( array($orig_line), false );
} else { // A true changed row.
$r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "</tr>\n";
@@ -288,7 +288,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
*/
function interleave_changed_lines( $orig, $final ) {
// Contains all pairwise string comparisons. Keys are such that this need only be a one dimensional array.
// Contains all pairwise string comparisons. Keys are such that this need only be a one dimensional array.
$matches = array();
foreach ( array_keys($orig) as $o ) {
foreach ( array_keys($final) as $f ) {
@@ -309,7 +309,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
if ( isset($orig_matches[$o]) && isset($final_matches[$f]) )
continue;
// First match for these guys. Must be best match
// First match for these guys. Must be best match
if ( !isset($orig_matches[$o]) && !isset($final_matches[$f]) ) {
$orig_matches[$o] = $f;
$final_matches[$f] = $o;
@@ -342,11 +342,11 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
if ( false === $final_pos ) { // This orig is paired with a blank final.
array_splice( $final_rows, $orig_pos, 0, -1 );
} elseif ( $final_pos < $orig_pos ) { // This orig's match is up a ways. Pad final with blank rows.
} elseif ( $final_pos < $orig_pos ) { // This orig's match is up a ways. Pad final with blank rows.
$diff_pos = $final_pos - $orig_pos;
while ( $diff_pos < 0 )
array_splice( $final_rows, $orig_pos, 0, $diff_pos++ );
} elseif ( $final_pos > $orig_pos ) { // This orig's match is down a ways. Pad orig with blank rows.
} elseif ( $final_pos > $orig_pos ) { // This orig's match is down a ways. Pad orig with blank rows.
$diff_pos = $orig_pos - $final_pos;
while ( $diff_pos < 0 )
array_splice( $orig_rows, $orig_pos, 0, $diff_pos++ );
@@ -427,7 +427,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
// L1-norm of difference vector.
$difference = array_sum( array_map( array(&$this, 'difference'), $chars1, $chars2 ) );
// $string1 has zero length? Odd. Give huge penalty by not dividing.
// $string1 has zero length? Odd. Give huge penalty by not dividing.
if ( !$string1 )
return $difference;