mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
WP Screen: after [34991], avoid unnecessary nesting levels and remove unused global import.
See #33646. Built from https://develop.svn.wordpress.org/trunk@35010 git-svn-id: http://core.svn.wordpress.org/trunk@34975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6ec8174ca1
commit
d021cb8bc0
@ -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
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-35009';
|
||||
$wp_version = '4.4-alpha-35010';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user