Strip trailing whitespace

git-svn-id: http://svn.automattic.com/wordpress/trunk@14924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-05-26 02:42:15 +00:00
parent 15d96a96b9
commit 1a552dd029
34 changed files with 183 additions and 183 deletions

View File

@ -1071,7 +1071,7 @@ table.widefat .spam a:hover,
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
#adminmenu li.current a.menu-top {
background: #aaa url(../images/menu-bits.gif) top left repeat-x;
background: #aaa url(../images/menu-bits.gif) top left repeat-x;
border: #aaa 1px solid;
color: #000;
}

View File

@ -207,6 +207,6 @@ textarea {
.message {
border: 1px solid #e6db55;
padding: 0.3em 0.6em;
margin: 5px 0 15px;
margin: 5px 0 15px;
background-color: #ffffe0;
}

View File

@ -88,7 +88,7 @@
}
#side-sortables .potential-menu-item ul {
margin-right: 0;
}
/* Button Primary Actions */

View File

@ -213,7 +213,7 @@ body {
#menu-container .submit { margin: 0px 0px 10px; padding: 0px; }
.meta-sep,
.submitdelete,
.submitdelete,
.submitcancel {
display:block;
float:left;
@ -239,7 +239,7 @@ body {
vertical-align: middle;
}
.button-controls {
.button-controls {
clear:both;
margin: 10px 0;
}
@ -280,7 +280,7 @@ body {
padding: 1em 0;
}
.menu ul {
.menu ul {
width: 100%;
}
.menu ul.sub-menu {
@ -525,18 +525,18 @@ clear:both;
/* Clearfix */
#menu-item-name-wrap:after,
#menu-item-url-wrap:after,
#menu-item-url-wrap:after,
#menu-name-label:after,
#menu-settings-column .inside:after,
#nav-menus-frame:after,
#nav-menus-frame:after,
#post-body-content:after,
.button-controls:after,
.button-controls:after,
.major-publishing-actions:after,
.menu-item-settings:after {
clear: both;
clear: both;
content: ".";
display: block;
height: 0;
height: 0;
visibility: hidden;
}
#nav-menus-frame, .button-controls, #menu-item-url-wrap, #menu-item-name-wrap { display: block; }

View File

@ -1175,14 +1175,14 @@ div.comment-item:hover .row-actions {
#sidemenu li a span.update-plugins {
position: absolute;
font-family: Helvetica, Arial, sans-serif;
font-size: 9px;
font-size: 9px;
line-height: 17px;
font-weight: bold;
margin-top: 1px;
margin-left: 7px;
-moz-border-radius: 10px;
-khtml-border-radius: 10px;
-webkit-border-radius: 10px;
margin-top: 1px;
margin-left: 7px;
-moz-border-radius: 10px;
-khtml-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}

View File

@ -118,7 +118,7 @@ class Custom_Image_Header {
elseif ( 2 == $step )
wp_enqueue_style('imgareaselect');
}
/**
* Check if header text is allowed
*
@ -272,7 +272,7 @@ class Custom_Image_Header {
jQuery('#text-color').val(old_color);
jQuery('#name').css('color', old_color);
jQuery('#desc').css('color', old_color);
pickColor(old_color);
pickColor(old_color);
} else {
//Hide text
jQuery( text_objects.toString() ).hide();
@ -371,7 +371,7 @@ class Custom_Image_Header {
y2: yinit,
maxHeight: <?php echo HEADER_IMAGE_HEIGHT; ?>,
maxWidth: <?php echo HEADER_IMAGE_WIDTH; ?>,
onInit: function () {
onInit: function () {
jQuery('#width').val(xinit);
jQuery('#height').val(yinit);
},

View File

@ -48,7 +48,7 @@ $stati = "'" . implode("', '", get_post_stati( array( 'internal' => false ), 'na
if ( $monthyears = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, YEAR(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `eyear`, MONTH(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `emonth` FROM $wpdb->posts WHERE post_type IN ($types) AND post_status IN ($stati) ORDER BY post_date ASC ") ) {
foreach ( $monthyears as $k => $monthyear )
$monthyears[$k]->lmonth = $wp_locale->get_month( $monthyear->month, 2 );
for( $s = 0, $e = count( $monthyears ) - 1; $e >= 0; $s++, $e-- ) {
for( $s = 0, $e = count( $monthyears ) - 1; $e >= 0; $s++, $e-- ) {
$dateoptions .= "\t<option value=\"" . $monthyears[$s]->year . '-' . zeroise( $monthyears[$s]->month, 2 ) . '">' . $monthyears[$s]->lmonth . ' ' . $monthyears[$s]->year . "</option>\n";
$edateoptions .= "\t<option value=\"" . $monthyears[$e]->eyear . '-' . zeroise( $monthyears[$e]->emonth, 2 ) . '">' . $monthyears[$e]->lmonth . ' ' . $monthyears[$e]->year . "</option>\n";
}

View File

@ -1266,7 +1266,7 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
);
if ( is_multisite() && current_user_can( 'manage_network_plugins' ) )
$install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
$install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
if ( $this->type == 'web' )
$install_actions['plugins_page'] = '<a href="' . admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';

View File

@ -25,65 +25,65 @@ define('WXR_VERSION', '1.0');
*/
function export_wp( $args = array() ) {
global $wpdb, $post_ids, $post, $wp_taxonomies;
if ( ! is_array( $args ) )
$args = array( 'author' => $args );
$defaults = array( 'author' => null, 'taxonomy' => null, 'post_type' => null, 'post_status' => null, 'start_date' => null, 'end_date' => null );
$args = wp_parse_args( $args, $defaults );
extract($args);
do_action('export_wp');
if( strlen( $start_date ) > 4 && strlen( $end_date ) > 4 )
$filename = 'wordpress.' . $start_date . '.' . $end_date . '.xml';
else
$filename = 'wordpress.' . date( 'Y-m-d' ) . '.xml';
header( 'Content-Description: File Transfer' );
header( 'Content-Disposition: attachment; filename=' . $filename );
header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
if ( $post_type && $post_type != 'all' )
$where = $wpdb->prepare("WHERE post_type = %s ", $post_type);
else
$where = "WHERE post_type != 'revision' ";
if ( $author && $author != 'all' ) {
$author_id = (int) $author;
$where .= $wpdb->prepare( "AND post_author = %d ", $author_id );
}
if ( $start_date && $start_date != 'all' )
$where .= $wpdb->prepare( "AND post_date >= %s ", $start_date );
if ( $end_date && $end_date != 'all' )
$where .= $wpdb->prepare( "AND post_date < %s ", $end_date );
if ( $taxonomy && is_array( $taxonomy ) ) {
foreach ( $taxonomy as $term_id ) {
if ( $term_id != 'all' )
$where .= $wpdb->prepare( "AND ID IN (SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d) ", $term_id );
}
}
if ( $post_status && $post_status != 'all' )
$where .= $wpdb->prepare( "AND post_status = %s", $status );
// grab a snapshot of post IDs, just in case it changes during the export
$post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC" );
$categories = (array) get_categories( array( 'get' => 'all' ) );
$tags = (array) get_tags( array( 'get' => 'all' ) );
$custom_taxonomies = $wp_taxonomies;
unset( $custom_taxonomies['category'] );
unset( $custom_taxonomies['post_tag'] );
unset( $custom_taxonomies['link_category'] );
$custom_taxonomies = array_keys( $custom_taxonomies );
$terms = (array) get_terms( $custom_taxonomies, array( 'get' => 'all' ) );
/**
* {@internal Missing Short Description}}
*
@ -94,19 +94,19 @@ function export_wp( $args = array() ) {
function wxr_missing_parents( $categories ) {
if ( ! is_array( $categories ) || empty( $categories ) )
return array();
foreach ( $categories as $category ){
$parents[$category->term_id] = $category->parent;
}
$parents = array_unique( array_diff( $parents, array_keys( $parents ) ) );
if ( $zero = array_search( '0', $parents ) )
unset( $parents[$zero] );
return $parents;
}
while ( $parents = wxr_missing_parents( $categories ) ) {
$found_parents = get_categories( array( 'include' => join( ', ', $parents) ) );
if ( is_array( $found_parents ) && count( $found_parents ) )
@ -114,7 +114,7 @@ function export_wp( $args = array() ) {
else
break;
}
// Put them in order to be inserted with no child going before its parent
$pass = 0;
$passes = 1000 + count( $categories );
@ -125,7 +125,7 @@ function export_wp( $args = array() ) {
$categories[] = $cat;
}
unset( $categories );
/**
* Place string in CDATA tag.
*
@ -136,13 +136,13 @@ function export_wp( $args = array() ) {
function wxr_cdata( $str ) {
if ( seems_utf8( $str ) == false )
$str = utf8_encode( $str );
// $str = ent2ncr(esc_html($str));
$str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '') . "]]>";
return $str;
}
/**
* {@internal Missing Short Description}}
*
@ -152,7 +152,7 @@ function export_wp( $args = array() ) {
*/
function wxr_site_url() {
global $current_site;
// mu: the base url
if ( isset( $current_site->domain ) )
return network_home_url();
@ -160,7 +160,7 @@ function export_wp( $args = array() ) {
else
return get_bloginfo_rss( 'url' );
}
/**
* {@internal Missing Short Description}}
*
@ -171,10 +171,10 @@ function export_wp( $args = array() ) {
function wxr_cat_name( $c ) {
if ( empty( $c->name ) )
return;
echo '<wp:cat_name>' . wxr_cdata( $c->name ) . '</wp:cat_name>';
}
/**
* {@internal Missing Short Description}}
*
@ -185,10 +185,10 @@ function export_wp( $args = array() ) {
function wxr_category_description( $c ) {
if ( empty( $c->description ) )
return;
echo '<wp:category_description>' . wxr_cdata($c->description) . '</wp:category_description>';
}
/**
* {@internal Missing Short Description}}
*
@ -199,10 +199,10 @@ function export_wp( $args = array() ) {
function wxr_tag_name( $t ) {
if ( empty( $t->name ) )
return;
echo '<wp:tag_name>' . wxr_cdata($t->name) . '</wp:tag_name>';
}
/**
* {@internal Missing Short Description}}
*
@ -213,10 +213,10 @@ function export_wp( $args = array() ) {
function wxr_tag_description( $t ) {
if ( empty( $t->description ) )
return;
echo '<wp:tag_description>' . wxr_cdata($t->description) . '</wp:tag_description>';
}
/**
* {@internal Missing Short Description}}
*
@ -227,10 +227,10 @@ function export_wp( $args = array() ) {
function wxr_term_name( $t ) {
if ( empty( $t->name ) )
return;
echo '<wp:term_name>' . wxr_cdata($t->name) . '</wp:term_name>';
}
/**
* {@internal Missing Short Description}}
*
@ -241,10 +241,10 @@ function export_wp( $args = array() ) {
function wxr_term_description( $t ) {
if ( empty( $t->description ) )
return;
echo '<wp:term_description>' . wxr_cdata($t->description) . '</wp:term_description>';
}
/**
* {@internal Missing Short Description}}
*
@ -252,10 +252,10 @@ function export_wp( $args = array() ) {
*/
function wxr_post_taxonomy() {
global $post;
$the_list = '';
$filter = 'rss';
$taxonomies = get_object_taxonomies( 'post' );
$terms = wp_get_post_terms( $post->ID, $taxonomies );
foreach ( (array) $terms as $term ) {
@ -271,9 +271,9 @@ function export_wp( $args = array() ) {
}
echo $the_list;
}
echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
<!-- It contains information about your blog's posts, comments, and categories. -->
@ -319,18 +319,18 @@ function export_wp( $args = array() ) {
<?php if ( $terms ) : foreach ( $terms as $t ) : ?>
<wp:term><wp:term_taxonomy><?php echo $t->taxonomy; ?></wp:term_taxonomy><wp:term_slug><?php echo $t->slug; ?></wp:term_slug><wp:term_parent><?php echo $t->parent ? $custom_taxonomies[$t->parent]->name : ''; ?></wp:term_parent><?php wxr_term_name( $t ); ?><?php wxr_term_description( $t ); ?></wp:term>
<?php endforeach; endif; ?>
<?php do_action( 'rss2_head' ); ?>
<?php if ( $post_ids ) {
global $wp_query;
$wp_query->in_the_loop = true; // Fake being in the loop.
// fetch 20 posts at a time rather than loading the entire table into memory
while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
$where = "WHERE ID IN (" . join( ',', $next_posts ) . ")";
$posts = $wpdb->get_results( "SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC" );
// Begin Loop
foreach ($posts as $post) {
setup_postdata( $post );
@ -346,7 +346,7 @@ function export_wp( $args = array() ) {
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
<dc:creator><?php echo wxr_cdata( get_the_author() ); ?></dc:creator>
<?php wxr_post_taxonomy() ?>
<guid isPermaLink="false"><?php the_guid(); ?></guid>
<description></description>
<content:encoded><?php echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) ); ?></content:encoded>
@ -397,8 +397,8 @@ function export_wp( $args = array() ) {
</wp:comment>
<?php } } ?>
</item>
<?php
}
<?php
}
}
} ?>
</channel>

View File

@ -603,7 +603,7 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
$needed_dirs = array_unique($needed_dirs);
foreach ( $needed_dirs as $dir ) {
// Check the parent folders of the folders all exist within the creation array.
// Check the parent folders of the folders all exist within the creation array.
if ( untrailingslashit($to) == $dir ) // Skip over the working directory, We know this exists (or will exist)
continue;
@ -682,7 +682,7 @@ function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
$needed_dirs = array_unique($needed_dirs);
foreach ( $needed_dirs as $dir ) {
// Check the parent folders of the folders all exist within the creation array.
// Check the parent folders of the folders all exist within the creation array.
if ( untrailingslashit($to) == $dir ) // Skip over the working directory, We know this exists (or will exist)
continue;

View File

@ -680,7 +680,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
*/
function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
$taxonomy_name = $taxonomy['args']->name;
// paginate browsing for large numbers of objects
$per_page = 50;
$pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
@ -966,7 +966,7 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
$result .= ( ! empty($menu_items) ) ? ' menu-instructions-inactive">' : '">';
$result .= __('Select menu items (pages, categories, links) from the boxes at left to begin building your custom menu.');
$result .= '</div>';
if( empty($menu_items) )
return $result;

View File

@ -315,9 +315,9 @@ function bulk_edit_posts( $post_data = null ) {
$taxonomy_obj = get_taxonomy($tax_name);
if ( isset( $tax_input[$tax_name]) && current_user_can( $taxonomy_obj->cap->assign_terms ) )
$new_terms = $tax_input[$tax_name];
else
else
$new_terms = array();
if ( $taxonomy_obj->hierarchical )
$current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'ids') );
else
@ -325,7 +325,7 @@ function bulk_edit_posts( $post_data = null ) {
$post_data['tax_input'][$tax_name] = array_merge( $current_terms, $new_terms );
}
if ( isset($new_cats) && in_array( 'category', $tax_names ) ) {
$cats = (array) wp_get_post_categories($post_ID);
$post_data['post_category'] = array_unique( array_merge($cats, $new_cats) );

View File

@ -709,7 +709,7 @@ Thanks!
'subdomain_install' => intval( $subdomain_install ),
'global_terms_enabled' => global_terms_enabled() ? '1' : '0'
);
if ( !intval( $subdomain_install ) )
if ( !intval( $subdomain_install ) )
$sitemeta['illegal_names'][] = 'blog';
$insert = '';

View File

@ -2837,7 +2837,7 @@ function do_meta_boxes($page, $context, $object) {
$hidden = get_hidden_meta_boxes($page);
printf('<div id="%s-sortables" class="meta-box-sortables">', htmlspecialchars($context));
printf('<div id="%s-sortables" class="meta-box-sortables">', htmlspecialchars($context));
$i = 0;
do {
@ -3233,7 +3233,7 @@ function settings_errors ( $setting = '', $sanitize = FALSE, $hide_on_update = F
*/
function manage_columns_prefs( $page ) {
$columns = get_column_headers( $page );
$hidden = get_hidden_columns( $page );
$hidden = get_hidden_columns( $page );
$special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username');
foreach ( $columns as $column => $title ) {
@ -3545,9 +3545,9 @@ function _post_states($post) {
/**
* Convert a screen string to a screen object
*
*
* @since 3.0.0
*
*
* @param string $screen The name of the screen
* @return object An object containing the safe screen name and id
*/
@ -3615,11 +3615,11 @@ function screen_meta($screen) {
echo screen_layout($screen);
if ( !empty( $screen_options ) ) {
?>
?>
<h5><?php _ex('Show on screen', 'Screen Options') ?></h5>
<?php
}
echo $screen_options;
echo $settings; ?>
<div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>

View File

@ -32,7 +32,7 @@ case 'dashboard_secondary' :
case 'dashboard_plugins' :
wp_dashboard_plugins_output();
break;
case 'dashboard_quick_press' :
wp_dashboard_quick_press_output();
break;

View File

@ -147,7 +147,7 @@ var wpNavMenu;
},
getItemData : function( itemType, id ) {
itemType = itemType || 'menu-item';
var itemData = {}, i,
fields = [
'menu-item-db-id',
@ -164,13 +164,13 @@ var wpNavMenu;
'menu-item-classes',
'menu-item-xfn'
];
if( !id && itemType == 'menu-item' ) {
id = this.find('.menu-item-data-db-id').val();
}
if( !id ) return itemData;
this.find('input').each(function() {
var field;
i = fields.length;
@ -179,7 +179,7 @@ var wpNavMenu;
field = fields[i] + '[' + id + ']';
else if( itemType == 'add-menu-item' )
field = 'menu-item[' + id + '][' + fields[i] + ']';
if (
this.name &&
field == this.name
@ -188,18 +188,18 @@ var wpNavMenu;
}
}
});
return itemData;
},
setItemData : function( itemData, itemType, id ) { // Can take a type, such as 'menu-item', or an id.
itemType = itemType || 'menu-item';
if( !id && itemType == 'menu-item' ) {
id = $('.menu-item-data-db-id', this).val();
}
if( !id ) return this;
this.find('input').each(function() {
var t = $(this), field;
$.each( itemData, function( attr, val ) {
@ -207,7 +207,7 @@ var wpNavMenu;
field = attr + '[' + id + ']';
else if( itemType == 'add-menu-item' )
field = 'menu-item[' + id + '][' + attr + ']';
if ( field == t.attr('name') ) {
t.val( val );
}

View File

@ -83,14 +83,14 @@ switch ( $action ) {
}
// get next in order
if (
if (
isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] + 1] )
) {
$next_item_id = $orders_to_dbids[$dbids_to_orders[$menu_item_id] + 1];
$next_item_data = (array) wp_setup_nav_menu_item( get_post( $next_item_id ) );
// if not siblings of same parent, bubble menu item up but keep order
if (
if (
! empty( $menu_item_data['menu_item_parent'] ) &&
(
empty( $next_item_data['menu_item_parent'] ) ||
@ -99,12 +99,12 @@ switch ( $action ) {
) {
$parent_db_id = in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids ) ? (int) $menu_item_data['menu_item_parent'] : 0;
$parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) );
if ( ! is_wp_error( $parent_object ) ) {
$parent_data = (array) $parent_object;
$menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
$menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
}
@ -114,16 +114,16 @@ switch ( $action ) {
$next_item_data['menu_order'] = $next_item_data['menu_order'] - 1;
$menu_item_data['menu_order'] = $menu_item_data['menu_order'] + 1;
$menu_item_data['menu_item_parent'] = $next_item_data['ID'];
$menu_item_data['menu_item_parent'] = $next_item_data['ID'];
update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
wp_update_post($menu_item_data);
wp_update_post($next_item_data);
}
// the item is last but still has a parent, so bubble up
} elseif (
} elseif (
! empty( $menu_item_data['menu_item_parent'] ) &&
in_array( $menu_item_data['menu_item_parent'], $orders_to_dbids )
) {
@ -174,16 +174,16 @@ switch ( $action ) {
$parent_data = (array) $parent_object;
// if there is something before the parent and parent a child of it, make menu item a child also of it
if (
! empty( $dbids_to_orders[$parent_db_id] ) &&
if (
! empty( $dbids_to_orders[$parent_db_id] ) &&
! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] ) &&
! empty( $parent_data['menu_item_parent'] )
) {
$menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
// else if there is something before parent and parent not a child of it, make menu item a child of that something's parent
} elseif (
! empty( $dbids_to_orders[$parent_db_id] ) &&
} elseif (
! empty( $dbids_to_orders[$parent_db_id] ) &&
! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] )
) {
$_possible_parent_id = (int) get_post_meta( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1], '_menu_item_menu_item_parent', true);
@ -210,12 +210,12 @@ switch ( $action ) {
}
// else this menu item is not a child of the previous
} elseif (
} elseif (
empty( $menu_item_data['menu_order'] ) ||
empty( $menu_item_data['menu_item_parent'] ) ||
! in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) ||
empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ||
$orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] != $menu_item_data['menu_item_parent']
$orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] != $menu_item_data['menu_item_parent']
) {
// just make it a child of the previous; keep the order
$menu_item_data['menu_item_parent'] = (int) $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1];
@ -533,7 +533,7 @@ require_once( 'admin-header.php' );
$auto_add = true;
else
$auto_add = false;
}
}
?>
<div class="auto-add-pages">
<label class="howto"><input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" value="1" /> <?php printf( __('Automatically add new top-level pages to this menu' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label>

View File

@ -225,7 +225,7 @@ function network_step1( $errors = false ) {
_e( 'Because your install is in a directory, the sites in your WordPress network must use sub-directories.' );
// Uh oh:
if ( !allow_subdirectory_install() )
echo ' <strong>' . __( 'Warning!' ) . ' ' . __( 'The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';
echo ' <strong>' . __( 'Warning!' ) . ' ' . __( 'The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';
?></td>
</tr>
<?php elseif ( !allow_subdirectory_install() ) : ?>
@ -348,9 +348,9 @@ define( 'BLOG_ID_CURRENT_SITE', 1 );</textarea>
?>
</li>
<?php
if (iis7_supports_permalinks()) {
if (iis7_supports_permalinks()) {
if (is_subdomain_install()) {
$web_config_file =
$web_config_file =
'<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
@ -381,7 +381,7 @@ define( 'BLOG_ID_CURRENT_SITE', 1 );</textarea>
</system.webServer>
</configuration>';
} else {
$web_config_file =
$web_config_file =
'<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
@ -438,24 +438,24 @@ RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^' . ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n";
if ( ! $subdomain_install )
$htaccess_file .= "\n# add a trailing slash to /wp-admin\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]' . "\n";
$htaccess_file .= "\n" . 'RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]';
// @todo custom content dir.
if ( ! $subdomain_install )
$htaccess_file .= "\nRewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]\nRewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]";
$htaccess_file .= "\nRewriteRule . index.php [L]";
?>
<li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>"><?php
echo wp_htmledit_pre( $htaccess_file );
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>"><?php
echo wp_htmledit_pre( $htaccess_file );
?>
</textarea></li>
</ol>

View File

@ -21,7 +21,7 @@ if ( isset($_GET['find_detached']) ) {
wp_die( __('You are not allowed to scan for lost attachments.') );
$lost = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent > '0' and post_parent NOT IN ( SELECT ID FROM $wpdb->posts WHERE post_type NOT IN ('attachment', '" . join("', '", get_post_types( array( 'public' => false ) ) ) . "') )");
$_GET['detached'] = 1;
} elseif ( isset($_GET['found_post_id']) && isset($_GET['media']) ) {
@ -168,7 +168,7 @@ add_contextual_help( $current_screen,
'<p>' . __('You can narrow the list by file type/status using the text link filters at the top of the screen. You also can refine the list by date using the dropdown menu above the media table.') . '</p>' .
'<p>' . __('Hovering over a row reveals action links: <em>Edit</em>, <em>Delete Permanently</em>, and <em>View</em>. Clicking <em>Edit</em> or on the media file&#8217;s name displays a simple screen to edit that individual file&#8217;s metadata. Clicking <em>Delete Permanently</em> will delete the file from the media library (as well as from any posts to which it is currently attached). <em>View</em> will take you to the display page for that file. ') . '</p>' .
'<p>' . __('If a media file has not been attached to any post, you will see that in the <em>Attached To</em> column, and can click on <em>Attach File</em> to launch a small popup that will allow you to search for a post and attach the file.') . '</p>' .
'<p>' . __('For more information:<br />
'<p>' . __('For more information:<br />
<a href="http://codex.wordpress.org/Media_Library_SubPanel">Media Library Documentation</a> <br />
<a href="http://wordpress.org/support/">Support Forums</a>') . '</p>'
);

View File

@ -286,7 +286,7 @@ function wp_templating_constants( ) {
/**
* Slug of the default theme for this install.
* Used as the default theme when installing new sites.
* Will be used as the fallback if the current theme doesn't exist.
* Will be used as the fallback if the current theme doesn't exist.
* @since 3.0.0
*/
if ( !defined('WP_DEFAULT_THEME') )

View File

@ -624,12 +624,12 @@ class WP_Widget_Recent_Comments extends WP_Widget {
function widget( $args, $instance ) {
global $comments, $comment;
$cache = wp_cache_get('widget_recent_comments', 'widget');
if ( ! is_array( $cache ) )
$cache = array();
if ( isset( $cache[$args['widget_id']] ) ) {
echo $cache[$args['widget_id']];
return;
@ -646,11 +646,11 @@ class WP_Widget_Recent_Comments extends WP_Widget {
$comments = get_comments( array( 'number' => $number, 'status' => 'approve' ) );
$output .= $before_widget;
if ( $title )
if ( $title )
$output .= $before_title . $title . $after_title;
$output .= '<ul id="recentcomments">';
if ( $comments ) {
if ( $comments ) {
foreach ( (array) $comments as $comment) {
$output .= '<li class="recentcomments">' . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x('%1$s on %2$s', 'widgets'), get_comment_author_link(), '<a href="' . esc_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
}

View File

@ -192,7 +192,7 @@ function _x( $single, $context, $domain = 'default' ) {
/**
* Displays translated string with gettext context
*
*
* @see _x
* @since 3.0.0
*
@ -506,13 +506,13 @@ function translate_user_role( $name ) {
* @return array Array of language codes or an empty array if no languages are present. Language codes are formed by stripping the .mo extension from the language file names.
*/
function get_available_languages( $dir = null ) {
$languages = array();
$languages = array();
foreach( (array)glob( ( is_null( $dir) ? WP_LANG_DIR : $dir ) . '/*.mo' ) as $lang_file ) {
if ( false === strpos( $lang_file, 'continents-cities' ) ) {
$languages[] = basename($lang_file, '.mo');
}
}
return $languages;
}

View File

@ -586,11 +586,11 @@ function get_category_feed_link($cat_id, $feed = '') {
*/
function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
global $wp_rewrite;
$term_id = ( int ) $term_id;
$term = get_term( $term_id, $taxonomy );
if ( empty( $term ) || is_wp_error( $term ) )
return false;
@ -601,10 +601,10 @@ function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
if ( '' == $permalink_structure ) {
if ( 'category' == $taxonomy ) {
$link = home_url("?feed=$feed&amp;cat=$term_id");
$link = home_url("?feed=$feed&amp;cat=$term_id");
}
elseif ( 'post_tag' == $taxonomy ) {
$link = home_url("?feed=$feed&amp;tag=$term->slug");
$link = home_url("?feed=$feed&amp;tag=$term->slug");
} else {
$t = get_taxonomy( $taxonomy );
$link = home_url("?feed=$feed&amp;$t->query_var=$term->slug");
@ -625,7 +625,7 @@ function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
$link = apply_filters( 'category_feed_link', $link, $feed );
else
$link = apply_filters( 'taxonomy_feed_link', $link, $feed, $taxonomy );
return $link;
}
@ -2185,7 +2185,7 @@ function wp_get_shortlink($id = 0, $context = 'post', $allow_slugs = true) {
$post_id = $wp_query->get_queried_object_id();
} elseif ( 'post' == $context ) {
$post = get_post($id);
$post_id = $post->ID;
$post_id = $post->ID;
}
$shortlink = '';

View File

@ -105,7 +105,7 @@ function ms_file_constants( ) {
function ms_subdomain_constants() {
static $error = null;
static $error_warn = false;
if ( false === $error )
return;
@ -130,7 +130,7 @@ function ms_subdomain_constants() {
} elseif ( defined( 'VHOST' ) ) {
$error = true;
define( 'SUBDOMAIN_INSTALL', 'yes' == VHOST );
} else {
} else {
define( 'SUBDOMAIN_INSTALL', false );
define( 'VHOST', 'no' );
}

View File

@ -257,7 +257,7 @@ function wp_nav_menu( $args = array() ) {
$sorted_menu_items = array();
foreach ( (array) $menu_items as $key => $menu_item )
$sorted_menu_items[$menu_item->menu_order] = $menu_item;
unset($menu_items);
$items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );
@ -307,7 +307,7 @@ function _wp_menu_item_classes_by_context( &$menu_items = array() ) {
$active_parent_object_ids = array();
$possible_object_parents = array();
$home_page_id = (int) get_option( 'page_for_posts' );
if ( $wp_query->is_singular && ! empty( $queried_object->post_type ) && ! is_post_type_hierarchical( $queried_object->post_type ) ) {
foreach ( (array) get_object_taxonomies( $queried_object->post_type ) as $taxonomy ) {
if ( is_taxonomy_hierarchical( $taxonomy ) ) {
@ -328,15 +328,15 @@ function _wp_menu_item_classes_by_context( &$menu_items = array() ) {
$active_parent_object_ids[] = (int) $menu_item->object_id;
$active_parent_item_ids[] = (int) $menu_item->db_id;
$active_object = $queried_object->post_type;
// if the menu item corresponds to the currently-queried post or taxonomy object
} elseif (
$menu_item->object_id == $queried_object_id &&
(
(
( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && $wp_query->is_home && $home_page_id = $menu_item->object_id ) ||
( 'post_type' == $menu_item->type && $wp_query->is_singular ) ||
( 'taxonomy' == $menu_item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) )
)
( 'taxonomy' == $menu_item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) )
)
) {
$menu_items[$key]->classes = trim( $menu_item->classes . ' ' . 'current-menu-item' );
$active_parent_item_ids[] = (int) $menu_item->menu_item_parent;
@ -363,11 +363,11 @@ function _wp_menu_item_classes_by_context( &$menu_items = array() ) {
// set parent's class
foreach ( (array) $menu_items as $key => $parent_item ) {
if (
isset( $parent_item->type ) &&
'post_type' == $parent_item->type &&
if (
isset( $parent_item->type ) &&
'post_type' == $parent_item->type &&
! empty( $queried_object->post_type ) &&
is_post_type_hierarchical( $queried_object->post_type ) &&
is_post_type_hierarchical( $queried_object->post_type ) &&
in_array( $parent_item->object_id, $queried_object->ancestors )
)
$menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-' . $queried_object->post_type . '-ancestor current-menu-ancestor' );

View File

@ -763,7 +763,7 @@ function _wp_auto_add_pages_to_menu( $new_status, $old_status, $post ) {
'menu-item-object' => $post->post_type,
'menu-item-type' => 'post_type',
);
foreach ( $auto_add as $menu_id ) {
$items = (array) wp_get_nav_menu_items( $menu_id );
foreach ( $items as $item ) {

View File

@ -105,11 +105,11 @@ function get_userdata( $user_id ) {
if ( ! is_numeric( $user_id ) )
return false;
$user_id = absint( $user_id );
if ( ! $user_id )
return false;
$user = wp_cache_get( $user_id, 'users' );
if ( $user )

View File

@ -743,7 +743,7 @@ function _wp_filter_build_unique_id($tag, $function, $priority) {
} else {
$function = (array) $function;
}
if (is_object($function[0]) ) {
// Object Class Calling
if ( function_exists('spl_object_hash') ) {

View File

@ -783,13 +783,13 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
* - 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.
* - 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().
* - labels - An array of labels for this post type. You can see accepted values in {@link get_post_type_labels()}. By default post labels are used for non-hierarchical types and page labels for hierarchical ones.
* - permalink_epmask - The default rewrite endpoint bitmasks.
* - permalink_epmask - The default rewrite endpoint bitmasks.
* - rewrite - false to prevent rewrite, or array('slug'=>$slug) to customize permastruct; default will use $taxonomy as slug.
* - query_var - false to prevent queries, or string to value of the query var to use for this post type
* - can_export - true allows this post type to be exported.
* - show_in_nav_menus - true makes this post type available for selection in navigation menus.
* - show_in_nav_menus - true makes this post type available for selection in navigation menus.
* - _builtin - true if this post type is a native or "built-in" post_type. THIS IS FOR INTERNAL USE ONLY!
* - _edit_link - URL segement to use for edit link of this post type. Set to 'post.php?post=%d'. THIS IS FOR INTERNAL USE ONLY!
* - _edit_link - URL segement to use for edit link of this post type. Set to 'post.php?post=%d'. THIS IS FOR INTERNAL USE ONLY!
*
* @since 2.9.0
* @uses $wp_post_types Inserts new post type object into the list
@ -888,7 +888,7 @@ function register_post_type($post_type, $args = array()) {
/**
* Builds an object with all post type capabilities out of a post type object
*
*
* Accepted keys of the capabilities array in the post type object:
* - edit_post - The meta capability that controls editing a particular object of this post type. Defaults to "edit_$capability_type" (edit_post).
* - edit_posts - The capability that controls editing objects of this post type as a class. Defaults to "edit_ . $capability_type . s" (edit_posts).
@ -897,7 +897,7 @@ function register_post_type($post_type, $args = array()) {
* - read_post - The meta capability that controls reading a particular object of this post type. Defaults to "read_$capability_type" (read_post).
* - read_private_posts - The capability that controls reading private posts. Defaults to "read_ . $capability_type . s" (read_private_posts).
* - delete_post - The meta capability that controls deleting a particular object of this post type. Defaults to "delete_$capability_type" (delete_post).
*
*
* @since 3.0.0
* @param object $args
* @return object object with all the capabilities as member variables
@ -918,7 +918,7 @@ function get_post_type_capabilities( $args ) {
/**
* Builds an object with all post type labels out of a post type object
*
*
* Accepted keys of the label array in the post type object:
* - name - general name for the post type, usually plural. The same and overriden by $post_type_object->label. Default is Posts/Pages
* - singular_name - name for one object of this post type. Default is Post/Page
@ -932,9 +932,9 @@ function get_post_type_capabilities( $args ) {
* - not_found - Default is No posts found/No pages found
* - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash
* - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page:
*
*
* Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages.)
*
*
* @since 3.0.0
* @param object $post_type_object
* @return object object with all the labels as member variables
@ -958,22 +958,22 @@ function get_post_type_labels( $post_type_object ) {
/**
* Builds an object with custom-something object (post type, taxonomy) labels out of a custom-something object
*
*
* @access private
*/
function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
if ( isset( $object->label ) ) {
$object->labels['name'] = $object->label;
}
if ( !isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) {
$object->labels['singular_name'] = $object->labels['name'];
}
$defaults = array_map( create_function( '$x', $object->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults );
$labels = array_merge( $defaults, $object->labels );
return (object)$labels;
return (object)$labels;
}
/**

View File

@ -1864,7 +1864,7 @@ class WP_Query {
$search .= " AND ($wpdb->posts.post_password = '') ";
}
}
// Allow plugins to contextually add/remove/modify the search section of the database query
$search = apply_filters_ref_array('posts_search', array( $search, &$this ) );

View File

@ -1775,7 +1775,7 @@ class WP_Rewrite {
<rules>
';
}
$rules .= '
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*" />

View File

@ -211,7 +211,7 @@ function is_taxonomy_hierarchical($taxonomy) {
* whether taxonomy exists.
*
* Optional $args contents:
*
*
* label - Name of the taxonomy shown in the menu. Usually plural. If not set, labels['name'] will be used.
*
* hierarchical - has some defined purpose at other parts of the API and is a
@ -234,7 +234,7 @@ function is_taxonomy_hierarchical($taxonomy) {
*
* show_tagcloud - false to prevent the taxonomy being listed in the Tag Cloud Widget;
* defaults to show_ui which defalts to public.
*
*
* labels - An array of labels for this taxonomy. You can see accepted values in {@link get_taxonomy_labels()}. By default tag labels are used for non-hierarchical types and category labels for hierarchical ones.
*
* @package WordPress
@ -303,7 +303,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
$args['labels'] = get_taxonomy_labels( (object) $args );
$args['label'] = $args['labels']->name;
$wp_taxonomies[$taxonomy] = (object) $args;
// register callback handling for metabox
@ -312,7 +312,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
/**
* Builds an object with all taxonomy labels out of a taxonomy object
*
*
* Accepted keys of the label array in the taxonomy object:
* - name - general name for the taxonomy, usually plural. The same as and overriden by $tax->label. Default is Post Tags/Categories
* - singular_name - name for one object of this taxonomy. Default is Post Tag/Category
@ -325,9 +325,9 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
* - update_item - Default is Update Tag/Update Category
* - add_new_item - Default is Add New Tag/Add New Category
* - new_item_name - Default is New Tag Name/New Category Name
*
*
* Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories.)
*
*
* @since 3.0.0
* @param object $tax Taxonomy object
* @return object object with all the labels as member variables

View File

@ -1716,7 +1716,7 @@ function require_if_theme_supports( $feature, $include) {
/**
* Checks an attachment being deleted to see if it's a header or background image.
*
*
* If true it removes the theme modification which would be pointing at the deleted
* attachment
*
@ -1728,7 +1728,7 @@ function _delete_attachment_theme_mod( $id ) {
$attachment_image = wp_get_attachment_url( $id );
$header_image = get_header_image();
$background_image = get_background_image();
if ( $header_image && $header_image == $attachment_image )
remove_theme_mod( 'header_image' );

View File

@ -36,14 +36,14 @@ $phone_delim = '::';
$pop3 = new POP3();
if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) )
if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) )
wp_die( esc_html( $pop3->ERROR ) );
$count = $pop3->pass( get_option('mailserver_pass') );
if( false === $count )
if( false === $count )
wp_die( esc_html( $pop3->ERROR ) );
if( 0 === $count ) {
$pop3->quit();
wp_die( __('There doesn&#8217;t seem to be any new mail.') );