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

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32965


git-svn-id: http://core.svn.wordpress.org/trunk@32936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-06-27 01:12:24 +00:00
parent a0e373ef80
commit 8b1286417e
8 changed files with 33 additions and 34 deletions

View File

@ -434,10 +434,13 @@ function _wp_ajax_add_hierarchical_term() {
$checked_categories[] = $cat_id;
if ( $parent ) // Do these all at once in a second
continue;
ob_start();
wp_terms_checklist( 0, array( 'taxonomy' => $taxonomy->name, 'descendants_and_self' => $cat_id, 'selected_cats' => $checked_categories, 'popular_cats' => $popular_ids ));
$data = ob_get_contents();
ob_end_clean();
$data = ob_get_clean();
$add = array(
'what' => $taxonomy->name,
'id' => $cat_id,
@ -458,9 +461,11 @@ function _wp_ajax_add_hierarchical_term() {
}
ob_start();
wp_terms_checklist( 0, array('taxonomy' => $taxonomy->name, 'descendants_and_self' => $term_id, 'selected_cats' => $checked_categories, 'popular_cats' => $popular_ids));
$data = ob_get_contents();
ob_end_clean();
$data = ob_get_clean();
$add = array(
'what' => $taxonomy->name,
'id' => $term_id,
@ -470,12 +475,14 @@ function _wp_ajax_add_hierarchical_term() {
}
ob_start();
wp_dropdown_categories( array(
'taxonomy' => $taxonomy->name, 'hide_empty' => 0, 'name' => 'new'.$taxonomy->name.'_parent', 'orderby' => 'name',
'hierarchical' => 1, 'show_option_none' => '— '.$taxonomy->labels->parent_item.' —'
) );
$sup = ob_get_contents();
ob_end_clean();
$sup = ob_get_clean();
$add['supplemental'] = array( 'newcat_parent' => $sup );
$x = new WP_Ajax_Response( $add );
@ -914,8 +921,7 @@ function wp_ajax_get_comments( $action ) {
get_comment( $comment );
$wp_list_table->single_row( $comment );
}
$comment_list_item = ob_get_contents();
ob_end_clean();
$comment_list_item = ob_get_clean();
$x->add( array(
'what' => 'comments',

View File

@ -947,9 +947,8 @@ class Automatic_Upgrader_Skin extends WP_Upgrader_Skin {
* @access public
*/
public function footer() {
$output = ob_get_contents();
$output = ob_get_clean();
if ( ! empty( $output ) )
$this->feedback( $output );
ob_end_clean();
}
}

View File

@ -771,8 +771,8 @@ function delete_plugins( $plugins, $deprecated = '' ) {
ob_start();
$url = wp_nonce_url('plugins.php?action=delete-selected&verify-delete=1&' . implode('&', $checked), 'bulk-plugins');
if ( false === ($credentials = request_filesystem_credentials($url)) ) {
$data = ob_get_contents();
ob_end_clean();
$data = ob_get_clean();
if ( ! empty($data) ){
include_once( ABSPATH . 'wp-admin/admin-header.php');
echo $data;
@ -784,8 +784,8 @@ function delete_plugins( $plugins, $deprecated = '' ) {
if ( ! WP_Filesystem($credentials) ) {
request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again
$data = ob_get_contents();
ob_end_clean();
$data = ob_get_clean();
if ( ! empty($data) ){
include_once( ABSPATH . 'wp-admin/admin-header.php');
echo $data;

View File

@ -27,8 +27,8 @@ function delete_theme($stylesheet, $redirect = '') {
if ( empty( $redirect ) )
$redirect = wp_nonce_url('themes.php?action=delete&stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet);
if ( false === ($credentials = request_filesystem_credentials($redirect)) ) {
$data = ob_get_contents();
ob_end_clean();
$data = ob_get_clean();
if ( ! empty($data) ){
include_once( ABSPATH . 'wp-admin/admin-header.php');
echo $data;
@ -40,8 +40,8 @@ function delete_theme($stylesheet, $redirect = '') {
if ( ! WP_Filesystem($credentials) ) {
request_filesystem_credentials($redirect, '', true); // Failed to connect, Error and request again
$data = ob_get_contents();
ob_end_clean();
$data = ob_get_clean();
if ( ! empty($data) ) {
include_once( ABSPATH . 'wp-admin/admin-header.php');
echo $data;

View File

@ -301,9 +301,7 @@ class WP_Customize_Control {
final public function get_content() {
ob_start();
$this->maybe_render();
$template = trim( ob_get_contents() );
ob_end_clean();
return $template;
return trim( ob_get_clean() );
}
/**

View File

@ -252,9 +252,7 @@ class WP_Customize_Panel {
final public function get_content() {
ob_start();
$this->maybe_render();
$template = trim( ob_get_contents() );
ob_end_clean();
return $template;
return trim( ob_get_clean() );
}
/**

View File

@ -269,9 +269,7 @@ class WP_Customize_Section {
final public function get_content() {
ob_start();
$this->maybe_render();
$template = trim( ob_get_contents() );
ob_end_clean();
return $template;
return trim( ob_get_clean() );
}
/**

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32964';
$wp_version = '4.3-alpha-32965';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.