WordPress.org

Make WordPress Core

Ticket #8613: 8613.patch

File 8613.patch, 931 bytes (added by hakre, 6 years ago)

Fix. Do not commit.

  • wp-admin/includes/template.php

     
    515515                $categories = get_categories('get=all'); 
    516516        } 
    517517 
    518         // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache) 
    519         $checked_categories = array(); 
    520         $keys = array_keys( $categories );  
    521          
    522         foreach( $keys as $k ) { 
    523                 if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) { 
    524                         $checked_categories[] = $categories[$k]; 
    525                         unset( $categories[$k] ); 
    526                 }        
    527         } 
    528  
    529         // Put checked cats on top 
    530         echo call_user_func_array(array(&$walker, 'walk'), array($checked_categories, 0, $args)); 
    531518        // Then the rest of them 
    532519        echo call_user_func_array(array(&$walker, 'walk'), array($categories, 0, $args)); 
    533520}