3 * WordPress Administration Screen API.
6 * @subpackage Administration
10 * Get the column headers for a screen
14 * @param string|WP_Screen $screen The screen you want the headers for
15 * @return array Containing the headers in the format id => UI String
17 function get_column_headers( $screen ) {
18 if ( is_string( $screen ) )
19 $screen = convert_to_screen( $screen );
21 static $column_headers = array();
23 if ( ! isset( $column_headers[ $screen->id ] ) )
24 $column_headers[ $screen->id ] = apply_filters( 'manage_' . $screen->id . '_columns', array() );
26 return $column_headers[ $screen->id ];
30 * Get a list of hidden columns.
34 * @param string|WP_Screen $screen The screen you want the hidden columns for
37 function get_hidden_columns( $screen ) {
38 if ( is_string( $screen ) )
39 $screen = convert_to_screen( $screen );
41 return (array) get_user_option( 'manage' . $screen->id . 'columnshidden' );
45 * Prints the meta box preferences for screen meta.
49 * @param string|WP_Screen $screen
51 function meta_box_prefs( $screen ) {
52 global $wp_meta_boxes;
54 if ( is_string( $screen ) )
55 $screen = convert_to_screen( $screen );
57 if ( empty($wp_meta_boxes[$screen->id]) )
60 $hidden = get_hidden_meta_boxes($screen);
62 foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) {
63 foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) {
64 foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) {
65 if ( false == $box || ! $box['title'] )
67 // Submit box cannot be hidden
68 if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] )
71 echo '<label for="' . $box_id . '-hide">';
72 echo '<input class="hide-postbox-tog" name="' . $box_id . '-hide" type="checkbox" id="' . $box_id . '-hide" value="' . $box_id . '"' . (! in_array($box_id, $hidden) ? ' checked="checked"' : '') . ' />';
73 echo "{$box['title']}</label>\n";
80 * Get Hidden Meta Boxes
84 * @param string|WP_Screen $screen Screen identifier
85 * @return array Hidden Meta Boxes
87 function get_hidden_meta_boxes( $screen ) {
88 if ( is_string( $screen ) )
89 $screen = convert_to_screen( $screen );
91 $hidden = get_user_option( "metaboxhidden_{$screen->id}" );
93 $use_defaults = ! is_array( $hidden );
95 // Hide slug boxes by default
96 if ( $use_defaults ) {
98 if ( 'post' == $screen->base ) {
99 if ( 'post' == $screen->post_type || 'page' == $screen->post_type || 'attachment' == $screen->post_type )
100 $hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
102 $hidden = array( 'slugdiv' );
104 $hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen );
107 return apply_filters( 'hidden_meta_boxes', $hidden, $screen, $use_defaults );
111 * Register and configure an admin screen option
115 * @param string $option An option name.
116 * @param mixed $args Option-dependent arguments.
118 function add_screen_option( $option, $args = array() ) {
119 $current_screen = get_current_screen();
121 if ( ! $current_screen )
124 $current_screen->add_option( $option, $args );
128 * Get the current screen object
132 * @return WP_Screen Current screen object
134 function get_current_screen() {
135 global $current_screen;
137 if ( ! isset( $current_screen ) )
140 return $current_screen;
144 * Set the current screen object
147 * @uses $current_screen
149 * @param mixed $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen,
150 * or an existing screen object.
152 function set_current_screen( $hook_name = '' ) {
153 WP_Screen::get( $hook_name )->set_current_screen();
157 * A class representing the admin screen.
162 final class WP_Screen {
164 * Any action associated with the screen. 'add' for *-add.php and *-new.php screens. Empty otherwise.
173 * The base type of the screen. This is typically the same as $id but with any post types and taxonomies stripped.
174 * For example, for an $id of 'edit-post' the base is 'edit'.
183 * The number of columns to display. Access with get_columns().
189 private $columns = 0;
192 * The unique ID of the screen.
201 * Which admin the screen is in. network | user | site | false
210 * Whether the screen is in the network admin.
212 * Deprecated. Use in_admin() instead.
222 * Whether the screen is in the user admin.
224 * Deprecated. Use in_admin() instead.
234 * The base menu parent.
235 * This is derived from $parent_file by removing the query string and any .php extension.
236 * $parent_file values of 'edit.php?post_type=page' and 'edit.php?post_type=post' have a $parent_base of 'edit'.
245 * The parent_file for the screen per the admin menu system.
246 * Some $parent_file values are 'edit.php?post_type=page', 'edit.php', and 'options-general.php'.
255 * The post type associated with the screen, if any.
256 * The 'edit.php?post_type=page' screen has a post type of 'page'.
257 * The 'edit-tags.php?taxonomy=$taxonomy&post_type=page' screen has a post type of 'page'.
266 * The taxonomy associated with the screen, if any.
267 * The 'edit-tags.php?taxonomy=category' screen has a taxonomy of 'category'.
275 * The help tab data associated with the screen, if any.
281 private $_help_tabs = array();
284 * The help sidebar data associated with screen, if any.
290 private $_help_sidebar = '';
293 * Stores old string-based help.
295 private static $_old_compat_help = array();
298 * The screen options associated with screen, if any.
304 private $_options = array();
307 * The screen object registry.
313 private static $_registry = array();
316 * Stores the result of the public show_screen_options function.
322 private $_show_screen_options;
325 * Stores the 'screen_settings' section of screen options.
331 private $_screen_settings;
334 * Fetches a screen object.
339 * @param string $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen.
340 * Defaults to the current $hook_suffix global.
341 * @return WP_Screen Screen object.
343 public static function get( $hook_name = '' ) {
345 if ( is_a( $hook_name, 'WP_Screen' ) )
348 $post_type = $taxonomy = null;
355 $id = $GLOBALS['hook_suffix'];
357 // For those pesky meta boxes.
358 if ( $hook_name && post_type_exists( $hook_name ) ) {
360 $id = 'post'; // changes later. ends up being $base.
362 if ( '.php' == substr( $id, -4 ) )
363 $id = substr( $id, 0, -4 );
365 if ( 'post-new' == $id || 'link-add' == $id || 'media-new' == $id || 'user-new' == $id ) {
366 $id = substr( $id, 0, -4 );
371 if ( ! $post_type && $hook_name ) {
372 if ( '-network' == substr( $id, -8 ) ) {
373 $id = substr( $id, 0, -8 );
374 $in_admin = 'network';
375 } elseif ( '-user' == substr( $id, -5 ) ) {
376 $id = substr( $id, 0, -5 );
380 $id = sanitize_key( $id );
381 if ( 'edit-comments' != $id && 'edit-tags' != $id && 'edit-' == substr( $id, 0, 5 ) ) {
382 $maybe = substr( $id, 5 );
383 if ( taxonomy_exists( $maybe ) ) {
386 } elseif ( post_type_exists( $maybe ) ) {
395 if ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN )
396 $in_admin = 'network';
397 elseif ( defined( 'WP_USER_ADMIN' ) && WP_USER_ADMIN )
403 if ( 'index' == $id )
405 elseif ( 'front' == $id )
410 // If this is the current screen, see if we can be more accurate for post types and taxonomies.
411 if ( ! $hook_name ) {
412 if ( isset( $_REQUEST['post_type'] ) )
413 $post_type = post_type_exists( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : false;
414 if ( isset( $_REQUEST['taxonomy'] ) )
415 $taxonomy = taxonomy_exists( $_REQUEST['taxonomy'] ) ? $_REQUEST['taxonomy'] : false;
419 if ( isset( $_GET['post'] ) )
420 $post_id = (int) $_GET['post'];
421 elseif ( isset( $_POST['post_ID'] ) )
422 $post_id = (int) $_POST['post_ID'];
427 $post = get_post( $post_id );
429 $post_type = $post->post_type;
433 if ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) )
441 if ( null === $post_type )
446 if ( null === $post_type )
448 $id .= '-' . $post_type;
451 if ( null === $taxonomy )
452 $taxonomy = 'post_tag';
453 // The edit-tags ID does not contain the post type. Look for it in the request.
454 if ( null === $post_type ) {
456 if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) )
457 $post_type = $_REQUEST['post_type'];
460 $id = 'edit-' . $taxonomy;
464 if ( 'network' == $in_admin ) {
467 } elseif ( 'user' == $in_admin ) {
472 if ( isset( self::$_registry[ $id ] ) ) {
473 $screen = self::$_registry[ $id ];
474 if ( $screen === get_current_screen() )
477 $screen = new WP_Screen();
481 $screen->base = $base;
482 $screen->action = $action;
483 $screen->post_type = (string) $post_type;
484 $screen->taxonomy = (string) $taxonomy;
485 $screen->is_user = ( 'user' == $in_admin );
486 $screen->is_network = ( 'network' == $in_admin );
487 $screen->in_admin = $in_admin;
489 self::$_registry[ $id ] = $screen;
495 * Makes the screen object the current screen.
497 * @see set_current_screen()
500 function set_current_screen() {
501 global $current_screen, $taxnow, $typenow;
502 $current_screen = $this;
503 $taxnow = $this->taxonomy;
504 $typenow = $this->post_type;
505 do_action( 'current_screen', $current_screen );
514 private function __construct() {}
517 * Indicates whether the screen is in a particular admin
521 * @param string $admin The admin to check against (network | user | site).
522 * If empty any of the three admins will result in true.
523 * @return boolean True if the screen is in the indicated admin, false otherwise.
526 public function in_admin( $admin = null ) {
527 if ( empty( $admin ) )
528 return (bool) $this->in_admin;
530 return ( $admin == $this->in_admin );
534 * Sets the old string-based contextual help for the screen.
536 * For backwards compatibility.
540 * @param WP_Screen $screen A screen object.
541 * @param string $help Help text.
543 static function add_old_compat_help( $screen, $help ) {
544 self::$_old_compat_help[ $screen->id ] = $help;
548 * Set the parent information for the screen.
549 * This is called in admin-header.php after the menu parent for the screen has been determined.
553 * @param string $parent_file The parent file of the screen. Typically the $parent_file global.
555 function set_parentage( $parent_file ) {
556 $this->parent_file = $parent_file;
557 list( $this->parent_base ) = explode( '?', $parent_file );
558 $this->parent_base = str_replace( '.php', '', $this->parent_base );
562 * Adds an option for the screen.
563 * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add screen options.
567 * @param string $option Option ID
568 * @param mixed $args Option-dependent arguments.
570 public function add_option( $option, $args = array() ) {
571 $this->_options[ $option ] = $args;
575 * Remove an option from the screen.
579 * @param string $option Option ID.
581 public function remove_option( $option ) {
582 unset( $this->_options[ $option ] );
586 * Remove all options from the screen.
590 public function remove_options() {
591 $this->_options = array();
595 * Get the options registered for the screen.
599 * @return array Options with arguments.
601 public function get_options() {
602 return $this->_options;
606 * Gets the arguments for an option for the screen.
610 * @param string $option Option ID.
611 * @param mixed $key Optional. Specific array key for when the option is an array.
613 public function get_option( $option, $key = false ) {
614 if ( ! isset( $this->_options[ $option ] ) )
617 if ( isset( $this->_options[ $option ][ $key ] ) )
618 return $this->_options[ $option ][ $key ];
621 return $this->_options[ $option ];
625 * Gets the help tabs registered for the screen.
629 * @return array Help tabs with arguments.
631 public function get_help_tabs() {
632 return $this->_help_tabs;
636 * Gets the arguments for a help tab.
640 * @param string $id Help Tab ID.
641 * @return array Help tab arguments.
643 public function get_help_tab( $id ) {
644 if ( ! isset( $this->_help_tabs[ $id ] ) )
646 return $this->_help_tabs[ $id ];
650 * Add a help tab to the contextual help for the screen.
651 * Call this on the load-$pagenow hook for the relevant screen.
656 * - string - title - Title for the tab.
657 * - string - id - Tab ID. Must be HTML-safe.
658 * - string - content - Help tab content in plain text or HTML. Optional.
659 * - callback - callback - A callback to generate the tab content. Optional.
662 public function add_help_tab( $args ) {
669 $args = wp_parse_args( $args, $defaults );
671 $args['id'] = sanitize_html_class( $args['id'] );
673 // Ensure we have an ID and title.
674 if ( ! $args['id'] || ! $args['title'] )
677 // Allows for overriding an existing tab with that ID.
678 $this->_help_tabs[ $args['id'] ] = $args;
682 * Removes a help tab from the contextual help for the screen.
686 * @param string $id The help tab ID.
688 public function remove_help_tab( $id ) {
689 unset( $this->_help_tabs[ $id ] );
693 * Removes all help tabs from the contextual help for the screen.
697 public function remove_help_tabs() {
698 $this->_help_tabs = array();
702 * Gets the content from a contextual help sidebar.
706 * @return string Contents of the help sidebar.
708 public function get_help_sidebar() {
709 return $this->_help_sidebar;
713 * Add a sidebar to the contextual help for the screen.
714 * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add a sidebar to the contextual help.
718 * @param string $content Sidebar content in plain text or HTML.
720 public function set_help_sidebar( $content ) {
721 $this->_help_sidebar = $content;
725 * Gets the number of layout columns the user has selected.
727 * The layout_columns option controls the max number and default number of
728 * columns. This method returns the number of columns within that range selected
729 * by the user via Screen Options. If no selection has been made, the default
730 * provisioned in layout_columns is returned. If the screen does not support
731 * selecting the number of layout columns, 0 is returned.
735 * @return int Number of columns to display.
737 public function get_columns() {
738 return $this->columns;
742 * Render the screen's help section.
744 * This will trigger the deprecated filters for backwards compatibility.
748 public function render_screen_meta() {
750 // Call old contextual_help_list filter.
751 self::$_old_compat_help = apply_filters( 'contextual_help_list', self::$_old_compat_help, $this );
753 $old_help = isset( self::$_old_compat_help[ $this->id ] ) ? self::$_old_compat_help[ $this->id ] : '';
754 $old_help = apply_filters( 'contextual_help', $old_help, $this->id, $this );
756 // Default help only if there is no old-style block of text and no new-style help tabs.
757 if ( empty( $old_help ) && ! $this->get_help_tabs() ) {
758 $default_help = apply_filters( 'default_contextual_help', '' );
760 $old_help = '<p>' . $default_help . '</p>';
764 $this->add_help_tab( array(
765 'id' => 'old-contextual-help',
766 'title' => __('Overview'),
767 'content' => $old_help,
771 $help_sidebar = $this->get_help_sidebar();
773 $help_class = 'hidden';
774 if ( ! $help_sidebar )
775 $help_class .= ' no-sidebar';
779 <div id="screen-meta" class="metabox-prefs">
781 <div id="contextual-help-wrap" class="<?php echo esc_attr( $help_class ); ?>" tabindex="-1" aria-label="<?php esc_attr_e('Contextual Help Tab'); ?>">
782 <div id="contextual-help-back"></div>
783 <div id="contextual-help-columns">
784 <div class="contextual-help-tabs">
787 $class = ' class="active"';
788 foreach ( $this->get_help_tabs() as $tab ) :
789 $link_id = "tab-link-{$tab['id']}";
790 $panel_id = "tab-panel-{$tab['id']}";
793 <li id="<?php echo esc_attr( $link_id ); ?>"<?php echo $class; ?>>
794 <a href="<?php echo esc_url( "#$panel_id" ); ?>" aria-controls="<?php echo esc_attr( $panel_id ); ?>">
795 <?php echo esc_html( $tab['title'] ); ?>
805 <?php if ( $help_sidebar ) : ?>
806 <div class="contextual-help-sidebar">
807 <?php echo $help_sidebar; ?>
811 <div class="contextual-help-tabs-wrap">
813 $classes = 'help-tab-content active';
814 foreach ( $this->get_help_tabs() as $tab ):
815 $panel_id = "tab-panel-{$tab['id']}";
818 <div id="<?php echo esc_attr( $panel_id ); ?>" class="<?php echo $classes; ?>">
820 // Print tab content.
821 echo $tab['content'];
823 // If it exists, fire tab callback.
824 if ( ! empty( $tab['callback'] ) )
825 call_user_func_array( $tab['callback'], array( $this, $tab ) );
829 $classes = 'help-tab-content';
836 // Setup layout columns
838 // Back compat for plugins using the filter instead of add_screen_option()
839 $columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );
841 if ( ! empty( $columns ) && isset( $columns[ $this->id ] ) )
842 $this->add_option( 'layout_columns', array('max' => $columns[ $this->id ] ) );
844 if ( $this->get_option( 'layout_columns' ) ) {
845 $this->columns = (int) get_user_option("screen_layout_$this->id");
847 if ( ! $this->columns && $this->get_option( 'layout_columns', 'default' ) )
848 $this->columns = $this->get_option( 'layout_columns', 'default' );
850 $GLOBALS[ 'screen_layout_columns' ] = $this->columns; // Set the global for back-compat.
852 // Add screen options
853 if ( $this->show_screen_options() )
854 $this->render_screen_options();
858 if ( ! $this->get_help_tabs() && ! $this->show_screen_options() )
861 <div id="screen-meta-links">
862 <?php if ( $this->get_help_tabs() ) : ?>
863 <div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle">
864 <a href="#contextual-help-wrap" id="contextual-help-link" class="show-settings" aria-controls="contextual-help-wrap" aria-expanded="false"><?php _e( 'Help' ); ?></a>
867 if ( $this->show_screen_options() ) : ?>
868 <div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">
869 <a href="#screen-options-wrap" id="show-settings-link" class="show-settings" aria-controls="screen-options-wrap" aria-expanded="false"><?php _e( 'Screen Options' ); ?></a>
876 public function show_screen_options() {
877 global $wp_meta_boxes;
879 if ( is_bool( $this->_show_screen_options ) )
880 return $this->_show_screen_options;
882 $columns = get_column_headers( $this );
884 $show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' );
886 switch ( $this->id ) {
888 $this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
891 $this->_screen_settings = '';
895 $this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this );
897 if ( $this->_screen_settings || $this->_options )
900 $this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
901 return $this->_show_screen_options;
905 * Render the screen options tab.
909 public function render_screen_options() {
910 global $wp_meta_boxes, $wp_list_table;
912 $columns = get_column_headers( $this );
913 $hidden = get_hidden_columns( $this );
917 <div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="<?php esc_attr_e('Screen Options Tab'); ?>">
918 <form id="adv-settings" action="" method="post">
919 <?php if ( isset( $wp_meta_boxes[ $this->id ] ) || $this->get_option( 'per_page' ) || ( $columns && empty( $columns['_title'] ) ) ) : ?>
920 <h5><?php _e( 'Show on screen' ); ?></h5>
924 if ( isset( $wp_meta_boxes[ $this->id ] ) ) : ?>
925 <div class="metabox-prefs">
927 meta_box_prefs( $this );
929 if ( 'dashboard' === $this->id && has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) {
930 if ( isset( $_GET['welcome'] ) ) {
931 $welcome_checked = empty( $_GET['welcome'] ) ? 0 : 1;
932 update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked );
934 $welcome_checked = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
935 if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) )
936 $welcome_checked = false;
938 echo '<label for="wp_welcome_panel-hide">';
939 echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />';
940 echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n";
947 if ( ! empty( $columns['_title'] ) ) : ?>
948 <h5><?php echo $columns['_title']; ?></h5>
950 <div class="metabox-prefs">
952 $special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname');
954 foreach ( $columns as $column => $title ) {
955 // Can't hide these for they are special
956 if ( in_array( $column, $special ) )
958 if ( empty( $title ) )
961 if ( 'comments' == $column )
962 $title = __( 'Comments' );
963 $id = "$column-hide";
964 echo '<label for="' . $id . '">';
965 echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( !in_array($column, $hidden), true, false ) . ' />';
966 echo "$title</label>\n";
973 $this->render_screen_layout();
974 $this->render_per_page_options();
975 echo $this->_screen_settings;
978 <div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
985 * Render the option for number of columns on the page
989 function render_screen_layout() {
990 if ( ! $this->get_option('layout_columns') )
993 $screen_layout_columns = $this->get_columns();
994 $num = $this->get_option( 'layout_columns', 'max' );
997 <h5 class="screen-layout"><?php _e('Screen Layout'); ?></h5>
998 <div class='columns-prefs'><?php
999 _e('Number of Columns:');
1000 for ( $i = 1; $i <= $num; ++$i ):
1002 <label class="columns-prefs-<?php echo $i; ?>">
1003 <input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>'
1004 <?php checked( $screen_layout_columns, $i ); ?> />
1005 <?php echo esc_html( $i ); ?>
1014 * Render the items per page option
1018 function render_per_page_options() {
1019 if ( ! $this->get_option( 'per_page' ) )
1022 $per_page_label = $this->get_option( 'per_page', 'label' );
1024 $option = $this->get_option( 'per_page', 'option' );
1026 $option = str_replace( '-', '_', "{$this->id}_per_page" );
1028 $per_page = (int) get_user_option( $option );
1029 if ( empty( $per_page ) || $per_page < 1 ) {
1030 $per_page = $this->get_option( 'per_page', 'default' );
1035 if ( 'edit_comments_per_page' == $option ) {
1036 $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
1037 $per_page = apply_filters( 'comments_per_page', $per_page, $comment_status );
1038 } elseif ( 'categories_per_page' == $option ) {
1039 $per_page = apply_filters( 'edit_categories_per_page', $per_page );
1041 $per_page = apply_filters( $option, $per_page );
1045 if ( isset( $this->post_type ) )
1046 $per_page = apply_filters( 'edit_posts_per_page', $per_page, $this->post_type );
1049 <div class="screen-options">
1050 <?php if ( $per_page_label ) : ?>
1051 <input type="number" step="1" min="1" max="999" class="screen-per-page" name="wp_screen_options[value]"
1052 id="<?php echo esc_attr( $option ); ?>" maxlength="3"
1053 value="<?php echo esc_attr( $per_page ); ?>" />
1054 <label for="<?php echo esc_attr( $option ); ?>">
1055 <?php echo esc_html( $per_page_label ); ?>
1059 echo get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false ); ?>
1060 <input type='hidden' name='wp_screen_options[option]' value='<?php echo esc_attr($option); ?>' />