Make WordPress Core


Ignore:
Timestamp:
06/27/2015 01:11:45 AM (9 years ago)
Author:
wonderboymusic
Message:

ob_get_contents() followed by ob_end_clean() can be replaced by ob_get_clean().

See #32444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r32778 r32965  
    435435        if ( $parent ) // Do these all at once in a second
    436436            continue;
     437
    437438        ob_start();
    438             wp_terms_checklist( 0, array( 'taxonomy' => $taxonomy->name, 'descendants_and_self' => $cat_id, 'selected_cats' => $checked_categories, 'popular_cats' => $popular_ids ));
    439         $data = ob_get_contents();
    440         ob_end_clean();
     439
     440        wp_terms_checklist( 0, array( 'taxonomy' => $taxonomy->name, 'descendants_and_self' => $cat_id, 'selected_cats' => $checked_categories, 'popular_cats' => $popular_ids ));
     441
     442        $data = ob_get_clean();
     443
    441444        $add = array(
    442445            'what' => $taxonomy->name,
     
    459462
    460463        ob_start();
    461             wp_terms_checklist( 0, array('taxonomy' => $taxonomy->name, 'descendants_and_self' => $term_id, 'selected_cats' => $checked_categories, 'popular_cats' => $popular_ids));
    462         $data = ob_get_contents();
    463         ob_end_clean();
     464
     465        wp_terms_checklist( 0, array('taxonomy' => $taxonomy->name, 'descendants_and_self' => $term_id, 'selected_cats' => $checked_categories, 'popular_cats' => $popular_ids));
     466
     467        $data = ob_get_clean();
     468
    464469        $add = array(
    465470            'what' => $taxonomy->name,
     
    471476
    472477    ob_start();
    473         wp_dropdown_categories( array(
    474             'taxonomy' => $taxonomy->name, 'hide_empty' => 0, 'name' => 'new'.$taxonomy->name.'_parent', 'orderby' => 'name',
    475             'hierarchical' => 1, 'show_option_none' => '— '.$taxonomy->labels->parent_item.' —'
    476         ) );
    477     $sup = ob_get_contents();
    478     ob_end_clean();
     478
     479    wp_dropdown_categories( array(
     480        'taxonomy' => $taxonomy->name, 'hide_empty' => 0, 'name' => 'new'.$taxonomy->name.'_parent', 'orderby' => 'name',
     481        'hierarchical' => 1, 'show_option_none' => '— '.$taxonomy->labels->parent_item.' —'
     482    ) );
     483
     484    $sup = ob_get_clean();
     485
    479486    $add['supplemental'] = array( 'newcat_parent' => $sup );
    480487
     
    915922        $wp_list_table->single_row( $comment );
    916923    }
    917     $comment_list_item = ob_get_contents();
    918     ob_end_clean();
     924    $comment_list_item = ob_get_clean();
    919925
    920926    $x->add( array(
Note: See TracChangeset for help on using the changeset viewer.