Make WordPress Core


Ignore:
Timestamp:
10/02/2011 06:59:36 AM (14 years ago)
Author:
azaozz
Message:

Add screen_options with contextual content, see #18690

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/screen.php

    r18863 r18864  
    643643        if ( ! isset( $_wp_contextual_help ) )
    644644            $_wp_contextual_help = array();
     645
    645646        $_wp_contextual_help = apply_filters( 'contextual_help_list', $_wp_contextual_help, $this );
    646647
     
    652653                'title'   => __('Screen Info'),
    653654                'content' => $contextual_help,
    654             ) );
    655         }
    656 
    657         // Add screen options tab
    658         if ( $this->show_screen_options() ) {
    659             $this->add_help_tab( array(
    660                 'title'    => __('Screen Options'),
    661                 'callback' => array( $this, 'render_screen_options' ),
    662655            ) );
    663656        }
     
    713706    }
    714707
    715     public function show_screen_options() {
     708    public function show_screen_options() { // not needed?
    716709        global $wp_meta_boxes, $wp_list_table;
    717710
     
    747740    }
    748741
     742    public function add_screen_options($before = '') {
     743        $this->add_help_tab( array(
     744            'title'    => __('Screen Options'),
     745            'id'       => 'screen-options',
     746            'callback' => array( $this, 'render_screen_options' ),
     747            'content'  => $before
     748        ));
     749    }
     750
    749751    /**
    750752     * Render the screen options tab.
     
    757759        $columns = get_column_headers( $this );
    758760        $hidden  = get_hidden_columns( $this );
     761        $this->_screen_settings = apply_filters( 'screen_settings', '', $this );
     762
     763        switch ( $this->id ) {
     764            case 'widgets':
     765                $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";
     766                break;
     767        }
    759768
    760769        ?>
Note: See TracChangeset for help on using the changeset viewer.