Ticket #3148: patch.diff
| File patch.diff, 3.4 KB (added by alexkingorg, 5 years ago) |
|---|
-
wp-includes/category.php
20 20 parse_str($args, $r); 21 21 22 22 $defaults = array('type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 23 'hide_empty' => true, 'include_last_update_time' => false, 'hierarchical' => 1, $exclude => '', $include=> '',23 'hide_empty' => true, 'include_last_update_time' => false, 'hierarchical' => 1, 'exclude' => '', 'include' => '', 24 24 'number' => ''); 25 25 $r = array_merge($defaults, $r); 26 26 if ( 'count' == $r['orderby'] ) -
wp-includes/post.php
99 99 } 100 100 } 101 101 102 if ( defined( WP_IMPORTING) )102 if ( defined('WP_IMPORTING') ) 103 103 unset($post_cache); 104 104 105 105 if ( $output == OBJECT ) { … … 923 923 wp_cache_add($page->ID, $page, 'pages'); 924 924 $_page = $page; 925 925 } else { 926 if ( isset($GLOBALS['page'] ) && ($page == $GLOBALS['page']->ID) ) {926 if ( isset($GLOBALS['page']->ID) && ($page == $GLOBALS['page']->ID) ) { 927 927 $_page = & $GLOBALS['page']; 928 928 wp_cache_add($_page->ID, $_page, 'pages'); 929 } elseif ( $_page= $GLOBALS['post_cache'][$page] ) {929 } elseif ( isset($_page) && $_page == $GLOBALS['post_cache'][$page] ) { 930 930 return get_post($page, $output); 931 } elseif ( $_page= wp_cache_get($page, 'pages') ) {931 } elseif ( isset($_page) && $_page == wp_cache_get($page, 'pages') ) { 932 932 // Got it. 933 933 } else { 934 934 $query = "SELECT * FROM $wpdb->posts WHERE ID= '$page' LIMIT 1"; -
wp-includes/classes.php
388 388 // If flat, start and end the element and skip the level checks. 389 389 if ( $flat) { 390 390 // Start the element. 391 if ( $element->$id_field != 0 ) {391 if ( isset($element->$id_field) && $element->$id_field != 0 ) { 392 392 $cb_args = array_merge( array($output, $element, $depth - 1), $args); 393 393 $output = call_user_func_array(array(&$this, 'start_el'), $cb_args); 394 394 } 395 395 396 396 // End the element. 397 if ( $element->$id_field != 0 ) {397 if ( isset($element->$id_field) && $element->$id_field != 0 ) { 398 398 $cb_args = array_merge( array($output, $element, $depth - 1), $args); 399 399 $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); 400 400 } … … 583 583 $link .= ')'; 584 584 } 585 585 586 if ( $show_count )586 if ( isset($show_count) && $show_count ) 587 587 $link .= ' ('.intval($category->category_count).')'; 588 588 589 if ( $show_date ) {589 if ( isset($show_date) && $show_date ) { 590 590 $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp); 591 591 } 592 592 -
wp-includes/category-template.php
219 219 'child_of' => 0, 'feed' => '', 'feed_image' => '', 'exclude' => '', 220 220 'hierarchical' => true, 'title_li' => __('Categories')); 221 221 $r = array_merge($defaults, $r); 222 $r['include_last_update_time'] = $r['show_date']; 222 if ( isset($r['show_date']) ) 223 $r['include_last_update_time'] = $r['show_date']; 223 224 extract($r); 224 225 225 226 $categories = get_categories($r);
