]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/screen.php
WordPress 4.1.2-scripts
[autoinstalls/wordpress.git] / wp-admin / includes / screen.php
index 7d4ec8815240cdd10057ee85c993445db0e1949d..0482d783e02473667bc48f82e322acccb663e32e 100644 (file)
@@ -25,7 +25,7 @@ function get_column_headers( $screen ) {
                /**
                 * Filter the column headers for a list table on a specific screen.
                 *
-                * The dynamic portion of the hook name, $screen->id, refers to the
+                * The dynamic portion of the hook name, `$screen->id`, refers to the
                 * ID of a specific screen. For example, the screen ID for the Posts
                 * list table is edit-post, so the filter for that screen would be
                 * manage_edit-post_columns.
@@ -34,7 +34,7 @@ function get_column_headers( $screen ) {
                 *
                 * @param array $columns An array of column headers. Default empty.
                 */
-               $column_headers[ $screen->id ] = apply_filters( 'manage_' . $screen->id . '_columns', array() );
+               $column_headers[ $screen->id ] = apply_filters( "manage_{$screen->id}_columns", array() );
        }
 
        return $column_headers[ $screen->id ];
@@ -60,7 +60,7 @@ function get_hidden_columns( $screen ) {
  *
  * @since 2.7.0
  *
- * @param string|WP_Screen $screen
+ * @param WP_Screen $screen
  */
 function meta_box_prefs( $screen ) {
        global $wp_meta_boxes;
@@ -177,7 +177,6 @@ function get_current_screen() {
  * Set the current screen object
  *
  * @since 3.0.0
- * @uses $current_screen
  *
  * @param mixed $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen,
  *     or an existing screen object.
@@ -530,7 +529,7 @@ final class WP_Screen {
         * @see set_current_screen()
         * @since 3.3.0
         */
-       function set_current_screen() {
+       public function set_current_screen() {
                global $current_screen, $taxnow, $typenow;
                $current_screen = $this;
                $taxnow = $this->taxonomy;
@@ -581,7 +580,7 @@ final class WP_Screen {
         * @param WP_Screen $screen A screen object.
         * @param string $help Help text.
         */
-       static function add_old_compat_help( $screen, $help ) {
+       public static function add_old_compat_help( $screen, $help ) {
                self::$_old_compat_help[ $screen->id ] = $help;
        }
 
@@ -593,7 +592,7 @@ final class WP_Screen {
         *
         * @param string $parent_file The parent file of the screen. Typically the $parent_file global.
         */
-       function set_parentage( $parent_file ) {
+       public function set_parentage( $parent_file ) {
                $this->parent_file = $parent_file;
                list( $this->parent_base ) = explode( '?', $parent_file );
                $this->parent_base = str_replace( '.php', '', $this->parent_base );
@@ -648,8 +647,10 @@ final class WP_Screen {
         *
         * @since 3.3.0
         *
-        * @param string $option Option ID.
-        * @param mixed $key Optional. Specific array key for when the option is an array.
+        * @param string $option Option name.
+        * @param string $key    Optional. Specific array key for when the option is an array.
+        *                       Default false.
+        * @return string The option value if set, null otherwise.
         */
        public function get_option( $option, $key = false ) {
                if ( ! isset( $this->_options[ $option ] ) )
@@ -967,10 +968,16 @@ final class WP_Screen {
 
                $show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' );
 
-               switch ( $this->id ) {
+               switch ( $this->base ) {
                        case 'widgets':
                                $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";
                                break;
+                       case 'post' :
+                               $expand = '<div class="editor-expand hidden"><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></div>';
+                               $this->_screen_settings = $expand;
+                               break;
                        default:
                                $this->_screen_settings = '';
                                break;
@@ -1011,11 +1018,10 @@ final class WP_Screen {
         * @since 3.3.0
         */
        public function render_screen_options() {
-               global $wp_meta_boxes, $wp_list_table;
+               global $wp_meta_boxes;
 
                $columns = get_column_headers( $this );
                $hidden  = get_hidden_columns( $this );
-               $post    = get_post();
 
                ?>
                <div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="<?php esc_attr_e('Screen Options Tab'); ?>">
@@ -1090,7 +1096,7 @@ final class WP_Screen {
         *
         * @since 3.3.0
         */
-       function render_screen_layout() {
+       public function render_screen_layout() {
                if ( ! $this->get_option('layout_columns') )
                        return;
 
@@ -1119,7 +1125,7 @@ final class WP_Screen {
         *
         * @since 3.3.0
         */
-       function render_per_page_options() {
+       public function render_per_page_options() {
                if ( ! $this->get_option( 'per_page' ) )
                        return;