Pinking shears

git-svn-id: http://svn.automattic.com/wordpress/trunk@16438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-11-17 18:47:34 +00:00
parent 01a32c0af0
commit 847499e531
35 changed files with 155 additions and 155 deletions

View File

@ -723,13 +723,13 @@ case 'add-menu-item' :
require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
// For performance reasons, we omit some object properties from the checklist.
// For performance reasons, we omit some object properties from the checklist.
// The following is a hacky way to restore them when adding non-custom items.
$menu_items_data = array();
foreach ( (array) $_POST['menu-item'] as $menu_item_data ) {
if (
! empty( $menu_item_data['menu-item-type'] ) &&
! empty( $menu_item_data['menu-item-type'] ) &&
'custom' != $menu_item_data['menu-item-type'] &&
! empty( $menu_item_data['menu-item-object-id'] )
) {
@ -739,19 +739,19 @@ case 'add-menu-item' :
break;
case 'taxonomy' :
$_object = get_term( $menu_item_data['menu-item-object-id'], $menu_item_data['menu-item-object'] );
$_object = get_term( $menu_item_data['menu-item-object-id'], $menu_item_data['menu-item-object'] );
break;
}
$_menu_items = array_map( 'wp_setup_nav_menu_item', array( $_object ) );
$_menu_items = array_map( 'wp_setup_nav_menu_item', array( $_object ) );
$_menu_item = array_shift( $_menu_items );
// Restore the missing menu item properties
$menu_item_data['menu-item-description'] = $_menu_item->description;
}
$menu_items_data[] = $menu_item_data;
}
}
$item_ids = wp_save_nav_menu_items( 0, $menu_items_data );
if ( is_wp_error( $item_ids ) )
@ -1077,7 +1077,7 @@ case 'wp-link-ajax':
require_once ABSPATH . WPINC . '/js/tinymce/wp-mce-link-includes.php';
wp_link_ajax( $_POST );
exit;
break;
case 'menu-locations-save':

View File

@ -1126,8 +1126,8 @@ table.widefat .spam a:hover,
.folded #adminmenu li.wp-has-current-submenu,
.folded #adminmenu li.menu-top.current {
background: #e0e0e0 url(../images/menu-bits-vs.gif?ver=20101102) top left repeat-x;
border: #5589aa 1px solid;
background: #e0e0e0 url(../images/menu-bits-vs.gif?ver=20101102) top left repeat-x;
border: #5589aa 1px solid;
color: #464646;
}

View File

@ -10,7 +10,7 @@
require_once('./admin.php');
if ( !current_user_can('edit_posts') )
wp_die(__('Cheatin’ uh?'));
$wp_list_table = get_list_table('WP_Comments_List_Table');
$wp_list_table->check_permissions();

View File

@ -11,7 +11,7 @@ require_once('./admin.php');
$tax = get_taxonomy( $taxnow );
if ( !current_user_can( $tax->cap->manage_terms ) )
wp_die( __( 'Cheatin’ uh?' ) );
$wp_list_table = get_list_table('WP_Terms_List_Table');
$wp_list_table->check_permissions();

View File

@ -98,7 +98,7 @@ class WP_Media_List_Table extends WP_List_Table {
if ( $this->detached ) {
submit_button( __( 'Scan for lost attachments' ), 'secondary', 'find_detached', false );
} elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) {
} elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) {
submit_button( __( 'Empty Trash' ), 'button-secondary apply', 'delete_all', false );
} ?>
</div>

View File

@ -194,7 +194,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
echo "<tr class='$class'>";
$blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site->domain, '', $blog['domain'] ) : $blog['path'];
list( $columns, $hidden ) = $this->get_column_info();
foreach ( $columns as $column_name => $column_display_name ) {

View File

@ -7,7 +7,7 @@
* @since 3.1.0
*/
class WP_MS_Themes_List_Table extends WP_List_Table {
var $site_id;
var $is_site_themes;
@ -34,7 +34,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
'plural' => 'plugins', // @todo replace with themes and add css
) );
}
function check_permissions() {
if ( is_multisite() ) {
$menu_perms = get_site_option( 'menu_items', array() );
@ -45,9 +45,9 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
}
}
if ( $this->is_site_themes && !current_user_can('manage_sites') )
wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) );
else if ( !$this->is_site_themes && !current_user_can('manage_network_themes') )
if ( $this->is_site_themes && !current_user_can('manage_sites') )
wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) );
else if ( !$this->is_site_themes && !current_user_can('manage_network_themes') )
wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) );
}
@ -64,7 +64,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
'upgrade' => array()
);
$site_allowed_themes = get_site_allowed_themes();
$site_allowed_themes = get_site_allowed_themes();
if ( !$this->is_site_themes ) {
$allowed_themes = $site_allowed_themes;
$themes_per_page = $this->get_items_per_page( 'themes_network_per_page' );
@ -72,7 +72,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
$allowed_themes = wpmu_get_blog_allowedthemes( $this->site_id );
$themes_per_page = $this->get_items_per_page( 'site_themes_network_per_page' );
}
$current = get_site_transient( 'update_themes' );
foreach ( (array) $themes['all'] as $key => $theme ) {
@ -89,10 +89,10 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
if ( isset( $current->response[ $theme['Template'] ] ) )
$themes['upgrade'][$key] = $themes['all'][$key];
if ( $this->is_site_themes && isset( $site_allowed_themes[$theme_key] ) ) {
unset( $themes['all'][$key] );
unset( $themes['enabled'][$key] );
unset( $themes['disabled'][$key] );
if ( $this->is_site_themes && isset( $site_allowed_themes[$theme_key] ) ) {
unset( $themes['all'][$key] );
unset( $themes['enabled'][$key] );
unset( $themes['disabled'][$key] );
}
}
@ -131,7 +131,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
'per_page' => $themes_per_page,
) );
}
function _search_callback( $theme ) {
static $term;
if ( is_null( $term ) )
@ -211,9 +211,9 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
break;
}
if ( $this->is_site_themes )
$url = 'site-themes.php?id=' . $this->site_id;
else
if ( $this->is_site_themes )
$url = 'site-themes.php?id=' . $this->site_id;
else
$url = 'themes.php';
$status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
@ -236,7 +236,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
$actions['disable-selected'] = __( 'Disable' );
if ( current_user_can( 'update_themes' ) )
$actions['update-selected'] = __( 'Update' );
return $actions;
}
@ -332,7 +332,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
echo implode( ' | ', $theme_meta );
echo "</div></td>";
break;
break;
break;
default:
echo "<td class='$column_name column-$column_name'$style>";

View File

@ -257,7 +257,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
$screen = get_current_screen();
if ( 'active' != $status ) {
$action = $screen->is_network ? 'network-activate-selected' : 'activate-selected';
$action = $screen->is_network ? 'network-activate-selected' : 'activate-selected';
$actions[ $action ] = __( 'Activate' );
}
@ -432,7 +432,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
}
if ( ! empty( $plugin_data['PluginURI'] ) )
$plugin_meta[] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . __( 'Visit plugin site' ) . '">' . __( 'Visit plugin site' ) . '</a>';
$plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );
echo implode( ' | ', $plugin_meta );

View File

@ -666,7 +666,7 @@ class WP_Posts_List_Table extends WP_List_Table {
default:
?>
<td <?php echo $attributes ?>><?php
<td <?php echo $attributes ?>><?php
if ( 'page' == $post->post_type )
do_action( 'manage_pages_custom_column', $column_name, $post->ID );
else

View File

@ -149,7 +149,7 @@ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_
list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
$widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
}
if ( is_blog_admin () )
$side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');
else if (is_network_admin() )
@ -421,7 +421,7 @@ function wp_network_dashboard_right_now() {
$user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );
$blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) );
$sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
if ( $actions ) {

View File

@ -96,7 +96,7 @@ function get_home_path() {
*
* @since 1.5.0
*
* @uses get_home_path
* @uses get_home_path
* @uses WP_CONTENT_DIR full filesystem path to the wp-content directory
* @param string $file filesystem path relative to the WordPress install directory or to the wp-content directory
* @return string full file system path to edit
@ -254,7 +254,7 @@ function validate_file_to_edit( $file, $allowed_files = '' ) {
* @uses current_user_can
* @uses wp_upload_dir
* @uses wp_unique_filename
* @uses delete_transient
* @uses delete_transient
* @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file.
* @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
* @return array On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).

View File

@ -17,7 +17,7 @@
*/
function get_list_table( $class ) {
$class = apply_filters( "get_list_table_$class", $class );
require_list_table( $class );
if ( class_exists( $class ) )

View File

@ -1119,7 +1119,7 @@ function get_media_item( $attachment_id, $args = null ) {
$thumb_url = false;
$post = get_post( $attachment_id );
$default_args = array( 'errors' => null, 'send' => $post->post_parent ? post_type_supports( get_post_type( $post->post_parent ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true );
$args = wp_parse_args( $args, $default_args );
extract( $args, EXTR_SKIP );

View File

@ -155,7 +155,7 @@ echo esc_html( $visibility_trans ); ?></span>
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
$post_formats = get_theme_support( 'post-formats' );
if ( is_array( $post_formats[0] ) ) :
if ( is_array( $post_formats[0] ) ) :
$post_format = get_post_format( $post->ID );
if ( !$post_format )
$post_format = '0';

View File

@ -485,7 +485,7 @@ function is_network_only_plugin( $plugin ) {
*
* @param string $plugin Plugin path to main plugin file with plugin data.
* @param string $redirect Optional. URL to redirect to.
* @param bool $network_wide Whether to enable the plugin for all sites in the
* @param bool $network_wide Whether to enable the plugin for all sites in the
* network or just the current site. Multisite only. Default is false.
* @param bool $silent Prevent calling activation hooks. Optional, default is false.
* @return WP_Error|null WP_Error on invalid file or null on success.

View File

@ -2119,7 +2119,7 @@ function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit', $
$class = $type; // Custom cases can just pass in the classes they want to be used
endswitch;
$text = ( NULL == $text ) ? __( 'Save Changes' ) : $text;
$attributes = '';
if ( is_array( $other_attributes ) ) {
foreach ( $other_attributes as $attribute => $value ) {
@ -2128,19 +2128,19 @@ function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit', $
} else if ( !empty( $other_attributes ) ) { // Attributes provided as a string
$attributes = $other_attributes;
}
// Default the id attribute to $name unless an id was specifically provided in $other_attributes
$id = $name;
if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) )
$id = $other_attributes['id'];
$button = '<input type="submit" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" class="' . esc_attr( $class );
$button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />';
if ( $wrap ) {
$button = '<p class="submit">' . $button . '</p>';
}
return $button;
}

View File

@ -69,7 +69,7 @@ window.listTable = {
if ( true === value )
data[key] = '';
else
data[key] = value;
data[key] = value;
});
this._callback = callback;

View File

@ -66,7 +66,7 @@ case 'edit' :
wp_enqueue_script( 'wp-ajax-response' );
wp_enqueue_script('image-edit');
wp_enqueue_style('imgareaselect');
add_contextual_help( $current_screen,
'<p>' . __('This screen allows you to edit five fields for metadata in a file within the media library.') . '</p>' .
'<p>' . __('For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.') . '</p>' .

View File

@ -311,7 +311,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
<a href="widgets.php" class="button alignleft"><?php _e('Cancel'); ?></a>
<?php
} else {
submit_button( __( 'Delete' ), 'button alignleft', 'removewidget', false );
submit_button( __( 'Delete' ), 'button alignleft', 'removewidget', false );
}
submit_button( __( 'Save Widget' ), 'button-primary alignright', 'savewidget', false ); ?>
<input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($widget_id); ?>" />

View File

@ -4,7 +4,7 @@
*
* This code handles the building and rendering of the press bar.
*/
/**
* Instantiate the admin bar object and set it up as a global for access elsewhere.
*
@ -22,11 +22,11 @@ function wp_admin_bar_init() {
/* Instantiate the admin bar */
$admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );
if ( class_exists( $admin_bar_class ) )
if ( class_exists( $admin_bar_class ) )
$wp_admin_bar = new $admin_bar_class;
else
return false;
$wp_admin_bar->initialize();
$wp_admin_bar->add_menus();
@ -60,7 +60,7 @@ function wp_admin_bar_render() {
$wp_admin_bar->render();
do_action( 'wp_after_admin_bar_render' );
$wp_admin_bar->unload_user_locale_translations();
}
add_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
@ -87,11 +87,11 @@ function wp_admin_bar_my_account_menu() {
global $wp_admin_bar, $user_identity;
$user_id = get_current_user_id();
if ( 0 != $user_id ) {
/* Add the 'My Account' menu */
$wp_admin_bar->add_menu( array( 'id' => 'my-account', 'title' => $user_identity, 'href' => get_edit_profile_url( $user_id ) ) );
/* Add the "My Account" sub menus */
$wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Edit My Profile' ), 'href' => get_edit_profile_url( $user_id ) ) );
if ( is_multisite() )
@ -157,7 +157,7 @@ function wp_admin_bar_blog_separator() {
/**
* Provide a shortlink.
*
*
* @since 3.1.0
*/
function wp_admin_bar_shortlink_menu() {
@ -171,7 +171,7 @@ function wp_admin_bar_shortlink_menu() {
/**
* Provide an edit link for posts and terms.
*
*
* @since 3.1.0
*/
function wp_admin_bar_edit_menu () {
@ -197,7 +197,7 @@ function wp_admin_bar_new_content_menu() {
$ptype_obj = get_post_type_object( $ptype );
if ( $ptype_obj->show_in_menu !== true || ! current_user_can( $ptype_obj->cap->edit_posts ) )
continue;
$actions["post-new.php?post_type=$ptype"] = array( $ptype_obj->labels->singular_name, $ptype_obj->cap->edit_posts, "new-$ptype" );
}
@ -259,7 +259,7 @@ function wp_admin_bar_updates_menu() {
if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
$wordpress_update_count = 1;
*/
$update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
if ( !$update_count )
@ -297,16 +297,16 @@ function wp_admin_bar_header() {
function wp_admin_body_style() {
?>
<style type="text/css">
<?php
if (
( empty( $_GET['nobump'] ) || is_admin() ) &&
! strpos( $_SERVER['REQUEST_URI'], 'media-upload.php' )
) :
<?php
if (
( empty( $_GET['nobump'] ) || is_admin() ) &&
! strpos( $_SERVER['REQUEST_URI'], 'media-upload.php' )
) :
?>
body { padding-top: 28px !important; }
<?php
endif;
<?php
endif;
if ( in_array( get_current_theme(), array('H3', 'H4', 'The Journalist v1.9') ) ) :
?>
@ -328,11 +328,11 @@ function wp_admin_body_style() {
*/
function is_admin_bar_showing() {
global $show_admin_bar;
/* For all these types of request we never want an admin bar period */
if ( defined('XMLRPC_REQUEST') || defined('APP_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') )
return false;
if ( ! isset( $show_admin_bar ) || null === $show_admin_bar ) {
if ( ! is_user_logged_in() || ( is_admin() && ! is_multisite() ) ) {
$show_admin_bar = false;

View File

@ -13,7 +13,7 @@ class WP_Admin_Bar {
}
/* Set the protocol used throughout this code */
if ( is_ssl() )
if ( is_ssl() )
$this->proto = 'https://';
$this->user = new stdClass;
@ -97,7 +97,7 @@ class WP_Admin_Bar {
<div id="adminbarsearch-wrap">
<form action="<?php echo home_url(); ?>" method="get" id="adminbarsearch">
<input class="adminbar-input" name="s" id="adminbar-search" type="text" title="<?php esc_attr_e( 'Search' ); ?>" value="" maxlength="150" />
<input class="adminbar-input" name="s" id="adminbar-search" type="text" title="<?php esc_attr_e( 'Search' ); ?>" value="" maxlength="150" />
<button type="submit" class="adminbar-button"><span><?php _e('Search'); ?></span></button>
</form>
</div>
@ -112,31 +112,31 @@ class WP_Admin_Bar {
function recursive_render( $id, &$menu_item ) { ?>
<?php $menuclass = ( ! empty( $menu_item['children'] ) ) ? 'menupop ' : ''; ?>
<li class="<?php echo $menuclass . "ab-$id" ?><?php
if ( ! empty( $menu_item['meta']['class'] ) ) :
<li class="<?php echo $menuclass . "ab-$id" ?><?php
if ( ! empty( $menu_item['meta']['class'] ) ) :
echo ' ' . $menu_item['meta']['class'];
endif;
endif;
?>">
<a href="<?php echo strip_tags( $menu_item['href'] ) ?>"<?php
<a href="<?php echo strip_tags( $menu_item['href'] ) ?>"<?php
if ( ! empty( $menu_item['meta']['onclick'] ) ) :
?> onclick="<?php echo $menu_item['meta']['onclick']; ?>"<?php
?> onclick="<?php echo $menu_item['meta']['onclick']; ?>"<?php
endif;
if ( ! empty( $menu_item['meta']['target'] ) ) :
?> target="<?php echo $menu_item['meta']['target']; ?>"<?php
endif;
?>><?php
if ( ! empty( $menuclass ) ) :
?><span><?php
endif;
?> target="<?php echo $menu_item['meta']['target']; ?>"<?php
endif;
?>><?php
if ( ! empty( $menuclass ) ) :
?><span><?php
endif;
echo $menu_item['title'];
if ( ! empty( $menuclass ) ) :
?></span><?php
endif;
if ( ! empty( $menuclass ) ) :
?></span><?php
endif;
?></a>
<?php if ( ! empty( $menu_item['children'] ) ) : ?>
@ -164,7 +164,7 @@ class WP_Admin_Bar {
if ( ! empty( $menu->{$id}['children'] ) )
$this->add_node( $parent_id, $menu->{$id}['children'], $child );
}
$child = null;
return false;
@ -204,7 +204,7 @@ class WP_Admin_Bar {
// TODO: Convert to a core feature for multisite or remove
function load_user_locale_translations() {
$this->need_to_change_locale = ( get_locale() != $this->user->locale );
if ( ! $this->need_to_change_locale )
if ( ! $this->need_to_change_locale )
return;
/*
$this->previous_translations = get_translations_for_domain( 'default' );
@ -218,7 +218,7 @@ class WP_Admin_Bar {
function unload_user_locale_translations() {
global $l10n;
if ( ! $this->changed_locale )
if ( ! $this->changed_locale )
return;
/*
remove_filter( 'locale', $this->adminbar_locale_filter );

View File

@ -23,7 +23,7 @@ class WP_HTTP_IXR_Client extends IXR_Client
$this->path = '/';
}
} else {
$this->scheme = 'http';
$this->scheme = 'http';
$this->server = $server;
$this->path = $path;
$this->port = $port;
@ -45,30 +45,30 @@ class WP_HTTP_IXR_Client extends IXR_Client
'user-agent' => $this->useragent,
'body' => $xml,
);
// Merge Custom headers ala #8145
foreach ( $this->headers as $header => $value )
$args['headers'][$header] = $value;
if ( $this->timeout !== false )
$args['timeout'] = $this->timeout;
// Now send the request
if ($this->debug) {
echo '<pre class="ixr_request">'.htmlspecialchars($xml)."\n</pre>\n\n";
}
$response = wp_remote_post($url, $args);
$response = wp_remote_post($url, $args);
if ( is_wp_error($response) ) {
$errno = $response->get_error_code();
$errorstr = $response->get_error_message();
$this->error = new IXR_Error(-32300, "transport error: $errno $errstr");
if ( is_wp_error($response) ) {
$errno = $response->get_error_code();
$errorstr = $response->get_error_message();
$this->error = new IXR_Error(-32300, "transport error: $errno $errstr");
return false;
}
$code = $response['response']['code'];
if ( $code != 200 ) {
$code = $response['response']['code'];
if ( $code != 200 ) {
$this->error = new IXR_Error(-32301, "transport error - HTTP status code was not 200 ($code)"); return false;
}

View File

@ -1488,12 +1488,12 @@ class wp_xmlrpc_server extends IXR_Server {
*
* @since 3.1.0
*
* @param array $args Method parameters. Contains:
* @param array $args Method parameters. Contains:
* - blog_id
* - username
* - password
* - attachment_id
* @return array. Assocciative array containing:
* @return array. Assocciative array containing:
* - 'date_created_gmt'
* - 'parent'
* - 'link'
@ -1545,18 +1545,18 @@ class wp_xmlrpc_server extends IXR_Server {
/**
* Retrieves a collection of media library items (or attachments)
*
* Besides the common blog_id, username, and password arguments, it takes a filter
*
* Besides the common blog_id, username, and password arguments, it takes a filter
* array as last argument.
*
*
* Accepted 'filter' keys are 'parent_id', 'mime_type', 'offset', and 'number'.
*
*
* The defaults are as follows:
* - 'number' - Default is 5. Total number of media items to retrieve.
* - 'offset' - Default is 0. See {@link WP_Query::query()} for more.
* - 'parent_id' - Default is ''. The post where the media item is attached. Empty string shows all media items. 0 shows unattached media items.
* - 'mime_type' - Default is ''. Filter by mime type (e.g., 'image/jpeg', 'application/pdf')
*
*
* @since 3.1.0
*
* @param array $args Method parameters. Contains:
@ -1587,7 +1587,7 @@ class wp_xmlrpc_server extends IXR_Server {
$mime_type = ( isset($struct['mime_type']) ) ? $struct['mime_type'] : '' ;
$offset = ( isset($struct['offset']) ) ? absint($struct['offset']) : 0 ;
$number = ( isset($struct['number']) ) ? absint($struct['number']) : -1 ;
$attachments = get_posts( array('post_type' => 'attachment', 'post_parent' => $parent_id, 'offset' => $offset, 'numberposts' => $number, 'post_mime_type' => $mime_type ) );
$num_attachments = count($attachments);

View File

@ -185,7 +185,7 @@ class WP_Scripts extends WP_Dependencies {
if ( 0 === strpos( $src, '/wp-includes/js/l10n' ) )
return false;
foreach ( (array) $this->default_dirs as $test ) {
if ( 0 === strpos($src, $test) )
return true;

View File

@ -1764,7 +1764,7 @@ function pingback($content, $post_ID) {
global $wp_version;
include_once(ABSPATH . WPINC . '/class-IXR.php');
include_once(ABSPATH . WPINC . '/class-wp-http-ixr-client.php');
// original code by Mort (http://mort.mine.nu:8080)
$post_links = array();

View File

@ -223,7 +223,7 @@ function wpautop($pee, $br = 1) {
/**
* Newline preservation help function for wpautop
*
*
* @since 3.1.0
* @access private
* @param array $matches preg_replace_callback matches array
@ -737,7 +737,7 @@ function sanitize_file_name( $filename ) {
* Sanitize username stripping out unsafe characters.
*
* Removes tags, octets, entities, and if strict is enabled, will only keep
* alphanumeric, _, space, ., -, @. After sanitizing, it passes the username,
* alphanumeric, _, space, ., -, @. After sanitizing, it passes the username,
* raw username (the username in the parameter), and the value of $strict as
* parameters for the 'sanitize_user' filter.
*
@ -1574,14 +1574,14 @@ function wp_iso_descrambler($string) {
/**
* Helper function to convert hex encoded chars to ascii
*
*
* @since 3.1.0
* @access private
* @param $match the preg_replace_callback matches array
*/
function _wp_iso_convert( $match ) {
return chr( hexdec( strtolower( $match[1] ) ) );
}
function _wp_iso_convert( $match ) {
return chr( hexdec( strtolower( $match[1] ) ) );
}
/**
* Returns a date in the GMT equivalent.

View File

@ -119,7 +119,7 @@ function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {
$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
}
$timezone_formats = array( 'P', 'I', 'O', 'T', 'Z', 'e' );
$timezone_formats_re = implode( '|', $timezone_formats );
$timezone_formats_re = implode( '|', $timezone_formats );
if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) && wp_timezone_supported() ) {
$timezone_string = get_option( 'timezone_string' );
if ( $timezone_string ) {
@ -132,9 +132,9 @@ function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {
$dateformatstring = preg_replace( "/([^\\\])$timezone_format/", "\\1" . backslashit( $formatted ), $dateformatstring );
$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
}
}
}
}
}
}
$j = @$datefunc( $dateformatstring, $i );
// allow plugins to redo this entirely for languages with untypical grammars
$j = apply_filters('date_i18n', $j, $req_format, $i, $gmt);
@ -1184,7 +1184,7 @@ function debug_fclose( $fp ) {
*/
function do_enclose( $content, $post_ID ) {
global $wpdb;
//TODO: Tidy this ghetto code up and make the debug code optional
include_once( ABSPATH . WPINC . '/class-IXR.php' );

View File

@ -289,7 +289,7 @@ function _nx_noop( $singular, $plural, $context ) {
/**
* Translate the result of _n_noop() or _nx_noop()
*
*
* @since 3.1
* @param array $nooped_plural array with singular, plural and context keys, usually the result of _n_noop() or _nx_noop()
* @param int $count number of objects

View File

@ -12,11 +12,11 @@ function wp_admin_bar_superadmin_settings_menu() {
/* Get the settings we need for the current site */
$matureaction = $current_blog->mature ? 'unmatureblog' : 'matureblog';
$maturetext_confirm = $current_blog->mature ?
sprintf(
$maturetext_confirm = $current_blog->mature ?
sprintf(
esc_attr__( 'Are you sure you want to unmark %s as mature?' ),
$current_blog->domain
) :
) :
sprintf(
esc_attr__( 'Are you sure you want to mark %s as mature?' ),
$current_blog->domain
@ -24,15 +24,15 @@ function wp_admin_bar_superadmin_settings_menu() {
$suspendaction = $current_blog->spam ? 'unspamblog' : 'spamblog';
$suspendtext_confirm = $current_blog->spam ?
sprintf(
sprintf(
esc_attr__( 'Are you sure you want to unsuspend site %s?' ),
$current_blog->domain
) :
) :
sprintf(
esc_attr__( 'Are you sure you want to suspend site %s?' ),
$current_blog->domain
);
$mature_url = network_admin_url( "edit.php?action=confirm&amp;action2={$matureaction}&amp;id={$current_blog->blog_id}&amp;msg=" . urlencode( $maturetext_confirm ) );
$suspend_url = network_admin_url( "edit.php?action=confirm&amp;action2={$suspendaction}&amp;id={$current_blog->blog_id}&amp;msg=" . urlencode( $suspendtext_confirm ) );

View File

@ -1374,7 +1374,7 @@ function maybe_add_existing_user_to_blog() {
function add_existing_user_to_blog( $details = false ) {
global $blog_id;
if ( is_array( $details ) ) {
$result = add_user_to_blog( $blog_id, $details[ 'user_id' ], $details[ 'role' ] );
do_action( 'added_existing_user', $details[ 'user_id' ], $result );

View File

@ -230,14 +230,14 @@ function get_the_content($more_link_text = null, $stripteaser = 0) {
/**
* Preview fix for javascript bug with foreign languages
*
*
* @since 3.1.0
* @access private
* @param array $match Match array from preg_replace_callback
* @returns string
*/
function _convert_urlencoded_to_entities( $match ) {
return '&#' . base_convert( $match[1], 16, 10 ) . ';';
return '&#' . base_convert( $match[1], 16, 10 ) . ';';
}
/**
@ -327,7 +327,7 @@ function get_post_class( $class = '', $post_id = null ) {
$classes[] = $post->post_type;
$classes[] = 'type-' . $post->post_type;
$classes[] = 'status-' . $post->post_status;
// Post Format
$post_format = get_post_format( $post->ID );
@ -339,7 +339,7 @@ function get_post_class( $class = '', $post_id = null ) {
// post requires password
if ( post_password_required($post->ID) )
$classes[] = 'post-password-required';
// sticky for Sticky Posts
if ( is_sticky($post->ID) && is_home() && !is_paged() )
$classes[] = 'sticky';
@ -428,7 +428,7 @@ function get_body_class( $class = '' ) {
$classes[] = 'single';
$classes[] = 'single-' . sanitize_html_class($post->post_type, $post_id);
$classes[] = 'postid-' . $post_id;
// Post Format
$post_format = get_post_format( $post->ID );

View File

@ -2273,7 +2273,7 @@ function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) {
_deprecated_argument( __FUNCTION__, '3.1', __( 'Passing an integer number of posts is deprecated. Pass an array of arguments instead.' ) );
$args = array( 'numberposts' => absint( $args ) );
}
// Set default arguments
$defaults = array(
'numberposts' => 10, 'offset' => 0,
@ -3137,9 +3137,9 @@ function get_page_by_path($page_path, $output = OBJECT, $post_type = 'page') {
$path = '/' . $leaf_path;
$curpage = $page;
while ( $curpage->post_parent != 0 ) {
$post_parent = $curpage->post_parent;
$curpage = wp_cache_get( $post_parent, 'posts' );
if ( false === $curpage )
$post_parent = $curpage->post_parent;
$curpage = wp_cache_get( $post_parent, 'posts' );
if ( false === $curpage )
$curpage = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = %d and post_type = %s", $post_parent, $post_type ) );
$path = '/' . $curpage->post_name . $path;
}
@ -5241,7 +5241,7 @@ function wp_quickpress_form( $args = array(), $post_type = 'post'){
*
* @since 3.1.0
*
* @return array The array of translations
* @return array The array of translations
*/
function get_post_format_strings() {
$strings = array(
@ -5260,7 +5260,7 @@ function get_post_format_strings() {
/**
* Returns a pretty, translated version of a post format slug
*
*
* @since 3.1.0
*
* @param string $slug A post format slug

View File

@ -45,7 +45,7 @@ function get_queried_object() {
/**
* Retrieve ID of the current queried object. Wrapper for $wp_query->get_queried_object_id()
*
*
* @uses WP_Query::get_queried_object_id()
*
* @since 3.1.0

View File

@ -61,7 +61,7 @@ function wp_default_scripts( &$scripts ) {
// Always ensure that we have the convertEntities function
$scripts->add( 'l10n', "/wp-includes/js/l10n$suffix.js", false, '20101110' );
$scripts->enqueue( 'l10n' );
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20101116' );
@ -260,15 +260,15 @@ function wp_default_scripts( &$scripts ) {
) );
$scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20100925' );
$scripts->add_data( 'user-profile', 'group', 1 );
$scripts->add_data( 'user-profile', 'group', 1 );
$scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", false, '20101117');
$scripts->add_data( 'admin-bar', 'group', 1 );
$scripts->add_data( 'admin-bar', 'group', 1 );
$scripts->localize( 'admin-bar', 'adminBarL10n', array(
'url' => __( 'URL:' ),
'noShortlink' => __( 'No shortlink available for this page.' ),
) );
if ( is_admin() ) {
$scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ), '20090102' );
$scripts->add_data( 'ajaxcat', 'group', 1 );
@ -501,7 +501,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
$styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100907' );
// Admin bar
$styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20101117' );

View File

@ -590,10 +590,10 @@ function get_tax_sql( $tax_query, $primary_table, $primary_id_column ) {
else {
// NOT IN is very slow for some reason
$where .= " AND $primary_table.$primary_id_column IN (
SELECT object_id
FROM $wpdb->term_relationships
WHERE term_taxonomy_id $operator ($terms)
)";
SELECT object_id
FROM $wpdb->term_relationships
WHERE term_taxonomy_id $operator ($terms)
)";
}
}
@ -1179,7 +1179,7 @@ function &get_terms($taxonomies, $args = '') {
foreach ( $pieces as $piece )
$$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
$query = "SELECT $fields FROM $wpdb->terms AS t $join WHERE $where $orderby $order $limits";
$query = "SELECT $fields FROM $wpdb->terms AS t $join WHERE $where $orderby $order $limits";
$fields = $_fields;