WP Screen: after [34991], avoid unnecessary nesting levels and remove unused global import.

See #33646.


git-svn-id: https://develop.svn.wordpress.org/trunk@35010 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-10-10 15:19:54 +00:00
parent e69aca18dc
commit b98303ae58

View File

@ -965,11 +965,8 @@ final class WP_Screen {
* @param array $options {
* @type bool $wrap Whether the screen-options-wrap div will be included. Defaults to true.
* }
* @global array $wp_meta_boxes
*/
public function render_screen_options( $options = array() ) {
global $wp_meta_boxes;
$options = wp_parse_args( $options, array(
'wrap' => true,
) );
@ -1003,11 +1000,16 @@ final class WP_Screen {
* Render the meta boxes preferences.
*
* @since 4.4.0
*
* @global array $wp_meta_boxes
*/
public function render_meta_boxes_preferences() {
global $wp_meta_boxes;
if ( isset( $wp_meta_boxes[ $this->id ] ) ) : ?>
if ( ! isset( $wp_meta_boxes[ $this->id ] ) ) {
return;
}
?>
<fieldset class="metabox-prefs">
<legend><?php _e( 'Boxes' ); ?></legend>
<?php
@ -1019,16 +1021,17 @@ final class WP_Screen {
update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked );
} else {
$welcome_checked = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) )
if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) {
$welcome_checked = false;
}
}
echo '<label for="wp_welcome_panel-hide">';
echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />';
echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n";
}
?>
</fieldset>
<?php endif;
<?php
}
/**
@ -1041,7 +1044,10 @@ final class WP_Screen {
$columns = get_column_headers( $this );
$hidden = get_hidden_columns( $this );
if ( $columns ) {
if ( ! $columns ) {
return;
}
$legend = ! empty( $columns['_title'] ) ? $columns['_title'] : __( 'Columns' );
?>
<fieldset class="metabox-prefs">
@ -1072,7 +1078,6 @@ final class WP_Screen {
</fieldset>
<?php
}
}
/**
* Render the option for number of columns on the page