WP_Screen::show_screen_options() WordPress Method
The WP_Screen::show_screen_options() method is used to show the "Screen Options" tab on a screen. This tab allows you to toggle the display of certain screen elements, such as the screen title, help text, and screen meta boxes.
WP_Screen::show_screen_options() #
Return
(bool)
More Information
This method automatically sets the $_screen_settings property and returns the $_show_screen_options property.
Source
File: wp-admin/includes/class-wp-screen.php
989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 | public function show_screen_options() { global $wp_meta_boxes ; if ( is_bool ( $this ->_show_screen_options ) ) { return $this ->_show_screen_options; } $columns = get_column_headers( $this ); $show_screen = ! empty ( $wp_meta_boxes [ $this ->id ] ) || $columns || $this ->get_option( 'per_page' ); $this ->_screen_settings = '' ; if ( 'post' === $this ->base ) { $expand = '<fieldset class="editor-expand hidden"><legend>' . __( 'Additional settings' ) . '</legend><label for="editor-expand-toggle">' ; $expand .= '<input type="checkbox" id="editor-expand-toggle"' . checked( get_user_setting( 'editor_expand' , 'on' ), 'on' , false ) . ' />' ; $expand .= __( 'Enable full-height editor and distraction-free functionality.' ) . '</label></fieldset>' ; $this ->_screen_settings = $expand ; } /** * Filters the screen settings text displayed in the Screen Options tab. * * @since 3.0.0 * * @param string $screen_settings Screen settings. * @param WP_Screen $screen WP_Screen object. */ $this ->_screen_settings = apply_filters( 'screen_settings' , $this ->_screen_settings, $this ); if ( $this ->_screen_settings || $this ->_options ) { $show_screen = true; } /** * Filters whether to show the Screen Options tab. * * @since 3.2.0 * * @param bool $show_screen Whether to show Screen Options tab. * Default true. * @param WP_Screen $screen Current WP_Screen instance. */ $this ->_show_screen_options = apply_filters( 'screen_options_show_screen' , $show_screen , $this ); return $this ->_show_screen_options; } |
Expand full source codeCollapse full source codeView on TracView on GitHub