Changeset 30982
- Timestamp:
- 12/20/2014 10:46:53 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/nav-menu.php
r30648 r30982 1253 1253 function wp_nav_menu_update_menu_items ( $nav_menu_selected_id, $nav_menu_selected_title ) { 1254 1254 $unsorted_menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID', 'post_status' => 'draft,publish' ) ); 1255 1255 $messages = array(); 1256 1256 $menu_items = array(); 1257 1257 // Index menu items by db ID -
trunk/src/wp-admin/includes/template.php
r30890 r30982 302 302 $default = 1; 303 303 304 $checked_categories = array(); 305 304 306 if ( $link_id ) { 305 307 $checked_categories = wp_get_link_cats( $link_id ); 306 308 // No selected categories, strange 307 if ( ! count( $checked_categories ) ) 309 if ( ! count( $checked_categories ) ) { 308 310 $checked_categories[] = $default; 311 } 309 312 } else { 310 313 $checked_categories[] = $default; -
trunk/src/wp-admin/includes/theme.php
r30944 r30982 431 431 432 432 WP_Theme::sort_by_name( $themes ); 433 434 $parents = array(); 435 433 436 foreach ( $themes as $theme ) { 434 437 $slug = $theme->get_stylesheet(); … … 470 473 471 474 // Remove 'delete' action if theme has an active child 472 if ( isset( $parents ) && array_key_exists( $current_theme, $parents ) ) {475 if ( ! empty( $parents ) && array_key_exists( $current_theme, $parents ) ) { 473 476 unset( $prepared_themes[ $parents[ $current_theme ] ]['actions']['delete'] ); 474 477 } -
trunk/src/wp-admin/includes/upgrade.php
r30742 r30982 1787 1787 if ($tableindices) { 1788 1788 // Clear the index array. 1789 unset($index_ary);1789 $index_ary = array(); 1790 1790 1791 1791 // For every index in the table. -
trunk/src/wp-includes/category-template.php
r30681 r30982 1290 1290 return false; 1291 1291 1292 $links = array(); 1293 1292 1294 foreach ( $terms as $term ) { 1293 1295 $link = get_term_link( $term, $taxonomy ); 1294 if ( is_wp_error( $link ) ) 1296 if ( is_wp_error( $link ) ) { 1295 1297 return $link; 1296 $term_links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>'; 1298 } 1299 $links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>'; 1297 1300 } 1298 1301 … … 1305 1308 * @since 2.5.0 1306 1309 * 1307 * @param array $ term_links An array of term links.1308 */ 1309 $term_links = apply_filters( "term_links-$taxonomy", $ term_links );1310 * @param array $links An array of term links. 1311 */ 1312 $term_links = apply_filters( "term_links-$taxonomy", $links ); 1310 1313 1311 1314 return $before . join( $sep, $term_links ) . $after; -
trunk/src/wp-includes/default-widgets.php
r30281 r30982 1267 1267 1268 1268 public function update( $new_instance, $old_instance ) { 1269 $instance = array(); 1269 1270 $instance['title'] = strip_tags(stripslashes($new_instance['title'])); 1270 1271 $instance['taxonomy'] = stripslashes($new_instance['taxonomy']); -
trunk/src/wp-includes/formatting.php
r30766 r30982 1023 1023 $string = strtr($string, $chars); 1024 1024 } else { 1025 $chars = array(); 1025 1026 // Assume ISO-8859-1 if not UTF-8 1026 1027 $chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158) … … 1038 1039 1039 1040 $string = strtr($string, $chars['in'], $chars['out']); 1041 $double_chars = array(); 1040 1042 $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254)); 1041 1043 $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th'); -
trunk/src/wp-includes/general-template.php
r30854 r30982 1439 1439 if ( ! $results = wp_cache_get( $key, 'posts' ) ) { 1440 1440 $results = $wpdb->get_results( $query ); 1441 $cache[ $key ] = $results;1442 1441 wp_cache_set( $key, $results, 'posts' ); 1443 1442 } … … 1658 1657 <tr>'; 1659 1658 1659 $daywithpost = array(); 1660 1660 1661 // Get days with posts 1661 1662 $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date) … … 1667 1668 $daywithpost[] = $daywith[0]; 1668 1669 } 1669 } else {1670 $daywithpost = array();1671 1670 } 1672 1671 -
trunk/src/wp-includes/media.php
r30674 r30982 587 587 // get the best one for a specified set of dimensions 588 588 if ( is_array($size) && !empty($imagedata['sizes']) ) { 589 $areas = array(); 590 589 591 foreach ( $imagedata['sizes'] as $_size => $data ) { 590 592 // already cropped to width or height; so use this size -
trunk/src/wp-includes/ms-deprecated.php
r30176 r30982 167 167 $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A ); 168 168 169 $blog_list = array(); 169 170 foreach ( (array) $blogs as $details ) { 170 171 $blog_list[ $details['blog_id'] ] = $details; 171 172 $blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( "SELECT COUNT(ID) FROM " . $wpdb->get_blog_prefix( $details['blog_id'] ). "posts WHERE post_status='publish' AND post_type='post'" ); 172 173 } 173 unset( $blogs ); 174 $blogs = $blog_list; 175 176 if ( false == is_array( $blogs ) ) 174 175 if ( ! $blog_list ) { 177 176 return array(); 178 179 if ( $num == 'all' ) 180 return array_slice( $blogs, $start, count( $blogs ) ); 181 else 182 return array_slice( $blogs, $start, $num ); 177 } 178 179 if ( $num == 'all' ) { 180 return array_slice( $blog_list, $start, count( $blog_list ) ); 181 } else { 182 return array_slice( $blog_list, $start, $num ); 183 } 183 184 } 184 185 -
trunk/src/wp-includes/ms-load.php
r30543 r30982 309 309 } 310 310 311 $paths = array(); 312 311 313 while ( count( $path_segments ) ) { 312 314 $paths[] = '/' . implode( '/', $path_segments ) . '/'; -
trunk/src/wp-includes/post.php
r30735 r30982 353 353 return $kids; 354 354 } elseif ( $output == ARRAY_A ) { 355 foreach ( (array) $kids as $kid ) 355 $weeuns = array(); 356 foreach ( (array) $kids as $kid ) { 356 357 $weeuns[$kid->ID] = get_object_vars($kids[$kid->ID]); 358 } 357 359 return $weeuns; 358 360 } elseif ( $output == ARRAY_N ) { 359 foreach ( (array) $kids as $kid ) 361 $babes = array(); 362 foreach ( (array) $kids as $kid ) { 360 363 $babes[$kid->ID] = array_values(get_object_vars($kids[$kid->ID])); 364 } 361 365 return $babes; 362 366 } else { … … 1682 1686 $object->labels['all_items'] = $object->labels['menu_name']; 1683 1687 1684 foreach ( $nohier_vs_hier_defaults as $key => $value ) 1685 $defaults[$key] = $object->hierarchical ? $value[1] : $value[0]; 1686 1688 $defaults = array(); 1689 foreach ( $nohier_vs_hier_defaults as $key => $value ) { 1690 $defaults[$key] = $object->hierarchical ? $value[1] : $value[0]; 1691 } 1687 1692 $labels = array_merge( $defaults, $object->labels ); 1688 1693 return (object)$labels; … … 2511 2516 if ( is_string($post_mime_types) ) 2512 2517 $post_mime_types = array_map('trim', explode(',', $post_mime_types)); 2518 2519 $wheres = array(); 2520 2513 2521 foreach ( (array) $post_mime_types as $mime_type ) { 2514 2522 $mime_type = preg_replace('/\s/', '', $mime_type); … … 5141 5149 } 5142 5150 5151 $types = array(); 5143 5152 // Icon basename - extension = MIME wildcard. 5144 5153 foreach ( $icon_files as $file => $uri ) … … 5514 5523 $ptypes = $post_type; 5515 5524 } elseif ( 'any' == $post_type ) { 5525 $ptypes = array(); 5516 5526 // Just use the post_types in the supplied posts. 5517 foreach ( $posts as $post ) 5527 foreach ( $posts as $post ) { 5518 5528 $ptypes[] = $post->post_type; 5529 } 5519 5530 $ptypes = array_unique($ptypes); 5520 5531 } else { -
trunk/src/wp-includes/rewrite.php
r30703 r30982 1289 1289 //build a list from the rewritecode and queryreplace arrays, that will look something like 1290 1290 //tagname=$matches[i] where i is the current $i 1291 $queries = array(); 1291 1292 for ( $i = 0; $i < $num_tokens; ++$i ) { 1292 1293 if ( 0 < $i ) … … 1329 1330 1330 1331 //get the 'tagname=$matches[i]' 1331 $query = ( isset($queries) && is_array($queries) && !empty($num_toks) ) ? $queries[$num_toks - 1] : '';1332 $query = ( ! empty( $num_toks ) && isset( $queries[$num_toks - 1] ) ) ? $queries[$num_toks - 1] : ''; 1332 1333 1333 1334 //set up $ep_mask_specific which is used to match more specific URL types -
trunk/src/wp-includes/taxonomy.php
r30954 r30982 3890 3890 3891 3891 $term_items = array(); 3892 $terms_by_id = array(); 3893 $term_ids = array(); 3892 3894 3893 3895 foreach ( (array) $terms as $key => $term ) { -
trunk/src/wp-includes/theme.php
r30787 r30982 407 407 408 408 $wp_theme_directories = (array) $wp_theme_directories; 409 $relative_theme_roots = array(); 409 410 410 411 // Set up maybe-relative, maybe-absolute array of theme directories.
Note: See TracChangeset
for help on using the changeset viewer.