WordPress.org

Make WordPress Core

Changeset 19119


Ignore:
Timestamp:
11/02/11 20:14:10 (2 years ago)
Author:
nacin
Message:

s/add_help_sidebar/set_help_sidebar/g and introduce screen->remove_help_tab($id) and screen->remove_help_tabs(). see #19020, #18785.

Location:
trunk/wp-admin
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-background.php

    r19111 r19119  
    8888        ); 
    8989 
    90         get_current_screen()->add_help_sidebar( 
     90        get_current_screen()->set_help_sidebar( 
    9191            '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 
    9292            '<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Background_Screen" target="_blank">Documentation on Custom Background</a>' ) . '</p>' . 
  • trunk/wp-admin/custom-header.php

    r19111 r19119  
    106106        ); 
    107107 
    108         get_current_screen()->add_help_sidebar( 
     108        get_current_screen()->set_help_sidebar( 
    109109            '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 
    110110            '<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Header_Screen" target="_blank">Documentation on Custom Header</a>' ) . '</p>' . 
  • trunk/wp-admin/edit-comments.php

    r19111 r19119  
    120120); 
    121121 
    122 get_current_screen()->add_help_sidebar( 
     122get_current_screen()->set_help_sidebar( 
    123123    '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 
    124124    '<p>' . __( '<a href="http://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' . 
  • trunk/wp-admin/edit-form-advanced.php

    r19110 r19119  
    204204    ) ); 
    205205 
    206     get_current_screen()->add_help_sidebar( 
     206    get_current_screen()->set_help_sidebar( 
    207207            '<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'options-writing.php') . '</p>' . 
    208208            '<p><strong>' . __('For more information:') . '</strong></p>' . 
     
    230230    ) ); 
    231231 
    232     get_current_screen()->add_help_sidebar( 
     232    get_current_screen()->set_help_sidebar( 
    233233            '<p><strong>' . __('For more information:') . '</strong></p>' . 
    234234            '<p>' . __('<a href="http://codex.wordpress.org/Pages_Add_New_Screen" target="_blank">Documentation on Adding New Pages</a>') . '</p>' . 
  • trunk/wp-admin/edit-link-form.php

    r19111 r19119  
    4646); 
    4747 
    48 get_current_screen()->add_help_sidebar( 
     48get_current_screen()->set_help_sidebar( 
    4949    '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 
    5050    '<p>' . __( '<a href="http://codex.wordpress.org/Links_Add_New_Screen" target="_blank">Documentation on Creating Links</a>' ) . '</p>' . 
  • trunk/wp-admin/edit-tags.php

    r19111 r19119  
    241241    $help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'; 
    242242 
    243     get_current_screen()->add_help_sidebar( $help ); 
     243    get_current_screen()->set_help_sidebar( $help ); 
    244244 
    245245    unset($help); 
  • trunk/wp-admin/edit.php

    r19111 r19119  
    168168    ); 
    169169 
    170     get_current_screen()->add_help_sidebar( 
     170    get_current_screen()->set_help_sidebar( 
    171171    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    172172    '<p>' . __('<a href="http://codex.wordpress.org/Posts_Screen" target="_blank">Documentation on Managing Posts</a>') . '</p>' . 
     
    180180    ); 
    181181 
    182     get_current_screen()->add_help_sidebar( 
     182    get_current_screen()->set_help_sidebar( 
    183183    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    184184    '<p>' . __('<a href="http://codex.wordpress.org/Pages_Screen" target="_blank">Documentation on Managing Pages</a>') . '</p>' . 
  • trunk/wp-admin/export.php

    r19111 r19119  
    4444); 
    4545 
    46 get_current_screen()->add_help_sidebar( 
     46get_current_screen()->set_help_sidebar( 
    4747    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    4848    '<p>' . __('<a href="http://codex.wordpress.org/Tools_Export_Screen" target="_blank">Documentation on Export</a>') . '</p>' . 
  • trunk/wp-admin/import.php

    r19111 r19119  
    2222); 
    2323 
    24 get_current_screen()->add_help_sidebar( 
     24get_current_screen()->set_help_sidebar( 
    2525    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    2626    '<p>' . __('<a href="http://codex.wordpress.org/Tools_Import_Screen" target="_blank">Documentation on Import</a>') . '</p>' . 
  • trunk/wp-admin/includes/screen.php

    r19113 r19119  
    154154        return; 
    155155 
    156     return $current_screen->add_option( $option, $args ); 
     156    $current_screen->add_option( $option, $args ); 
    157157} 
    158158 
     
    598598    /** 
    599599     * Add a help tab to the contextual help for the screen. 
    600      * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add contextual help tabs. 
     600     * Call this on the load-$pagenow hook for the relevant screen. 
    601601     * 
    602602     * @since 3.3.0 
     
    628628 
    629629    /** 
     630     * Removes a help tab from the contextual help for the screen. 
     631     * 
     632     * @since 3.3.0 
     633     * 
     634     * @param string $id The help tab ID. 
     635     */ 
     636    public function remove_help_tab( $id ) { 
     637        unset( $this->_help_tabs[ $id ] ); 
     638    } 
     639 
     640    /** 
     641     * Removes all help tabs from the contextual help for the screen. 
     642     * 
     643     * @since 3.3.0 
     644     */ 
     645    public function remove_help_tabs() { 
     646        $this->_help_tabs = array(); 
     647    } 
     648 
     649    /** 
    630650     * Add a sidebar to the contextual help for the screen. 
    631651     * 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. 
     
    635655     * @param string $content Sidebar content in plain text or HTML. 
    636656     */ 
    637     public function add_help_sidebar( $content ) { 
     657    public function set_help_sidebar( $content ) { 
    638658        $this->_help_sidebar = $content; 
    639659    } 
  • trunk/wp-admin/index.php

    r19110 r19119  
    7171) ); 
    7272 
    73 get_current_screen()->add_help_sidebar( 
     73get_current_screen()->set_help_sidebar( 
    7474    '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 
    7575    '<p>' . __( '<a href="http://codex.wordpress.org/Dashboard_Screen" target="_blank">Documentation on Dashboard</a>' ) . '</p>' . 
  • trunk/wp-admin/link-manager.php

    r19111 r19119  
    4848); 
    4949 
    50 get_current_screen()->add_help_sidebar( 
     50get_current_screen()->set_help_sidebar( 
    5151    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    5252    '<p>' . __('<a href="http://codex.wordpress.org/Links_Screen" target="_blank">Documentation on Managing Links</a>') . '</p>' . 
  • trunk/wp-admin/media-upload.php

    r19111 r19119  
    6868    ); 
    6969 
    70     get_current_screen()->add_help_sidebar( 
     70    get_current_screen()->set_help_sidebar( 
    7171        '<p><strong>' . __('For more information:') . '</strong></p>' . 
    7272        '<p>' . __('<a href="http://codex.wordpress.org/Media_Add_New_Screen" target="_blank">Documentation on Uploading Media Files</a>') . '</p>' . 
  • trunk/wp-admin/nav-menus.php

    r19111 r19119  
    452452add_contextual_help($current_screen, $help); 
    453453 
    454 get_current_screen()->add_help_sidebar( 
     454get_current_screen()->set_help_sidebar( 
    455455    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    456456    '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Menus_Screen" target="_blank">Documentation on Menus</a>') . '</p>' . 
  • trunk/wp-admin/options-discussion.php

    r19111 r19119  
    2121); 
    2222 
    23 get_current_screen()->add_help_sidebar( 
     23get_current_screen()->set_help_sidebar( 
    2424    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    2525    '<p>' . __('<a href="http://codex.wordpress.org/Settings_Discussion_Screen" target="_blank">Documentation on Discussion Settings</a>') . '</p>' . 
  • trunk/wp-admin/options-general.php

    r19111 r19119  
    6868); 
    6969 
    70 get_current_screen()->add_help_sidebar( 
     70get_current_screen()->set_help_sidebar( 
    7171    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    7272    '<p>' . __('<a href="http://codex.wordpress.org/Settings_General_Screen" target="_blank">Documentation on General Settings</a>') . '</p>' . 
  • trunk/wp-admin/options-media.php

    r19111 r19119  
    2323); 
    2424 
    25 get_current_screen()->add_help_sidebar( 
     25get_current_screen()->set_help_sidebar( 
    2626    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    2727    '<p>' . __('<a href="http://codex.wordpress.org/Settings_Media_Screen" target="_blank">Documentation on Media Settings</a>') . '</p>' . 
  • trunk/wp-admin/options-permalink.php

    r19111 r19119  
    2424); 
    2525 
    26 get_current_screen()->add_help_sidebar( 
     26get_current_screen()->set_help_sidebar( 
    2727    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    2828    '<p>' . __('<a href="http://codex.wordpress.org/Settings_Permalinks_Screen" target="_blank">Documentation on Permalinks Settings</a>') . '</p>' . 
  • trunk/wp-admin/options-privacy.php

    r19111 r19119  
    2222); 
    2323 
    24 get_current_screen()->add_help_sidebar( 
     24get_current_screen()->set_help_sidebar( 
    2525    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    2626    '<p>' . __('<a href="http://codex.wordpress.org/Settings_Privacy_Screen" target="_blank">Documentation on Privacy Settings</a>') . '</p>' . 
  • trunk/wp-admin/options-reading.php

    r19111 r19119  
    4949); 
    5050 
    51 get_current_screen()->add_help_sidebar( 
     51get_current_screen()->set_help_sidebar( 
    5252    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    5353    '<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_Screen" target="_blank">Documentation on Reading Settings</a>') . '</p>' . 
  • trunk/wp-admin/options-writing.php

    r19111 r19119  
    2121); 
    2222 
    23 get_current_screen()->add_help_sidebar( 
     23get_current_screen()->set_help_sidebar( 
    2424    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    2525    '<p>' . __('<a href="http://codex.wordpress.org/Settings_Writing_Screen" target="_blank">Documentation on Writing Settings</a>') . '</p>' . 
  • trunk/wp-admin/plugins.php

    r19111 r19119  
    326326); 
    327327 
    328 get_current_screen()->add_help_sidebar( 
     328get_current_screen()->set_help_sidebar( 
    329329    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    330330    '<p>' . __('<a href="http://codex.wordpress.org/Managing_Plugins#Plugin_Management" target="_blank">Documentation on Managing Plugins</a>') . '</p>' . 
  • trunk/wp-admin/themes.php

    r19111 r19119  
    4545add_contextual_help($current_screen, $help); 
    4646 
    47 get_current_screen()->add_help_sidebar( 
     47get_current_screen()->set_help_sidebar( 
    4848    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    4949    '<p>' . __('<a href="http://codex.wordpress.org/Using_Themes" target="_blank">Documentation on Using Themes</a>') . '</p>' . 
  • trunk/wp-admin/tools.php

    r19111 r19119  
    1818); 
    1919 
    20 get_current_screen()->add_help_sidebar( 
     20get_current_screen()->set_help_sidebar( 
    2121    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    2222    '<p>' . __('<a href="http://codex.wordpress.org/Tools_Screen" target="_blank">Documentation on Tools</a>') . '</p>' . 
  • trunk/wp-admin/update-core.php

    r19111 r19119  
    425425); 
    426426 
    427 get_current_screen()->add_help_sidebar( 
     427get_current_screen()->set_help_sidebar( 
    428428    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    429429    '<p>' . __('<a href="http://codex.wordpress.org/Dashboard_Updates_Screen" target="_blank">Documentation on Updating WordPress</a>') . '</p>' . 
  • trunk/wp-admin/upload.php

    r19111 r19119  
    153153); 
    154154 
    155 get_current_screen()->add_help_sidebar( 
     155get_current_screen()->set_help_sidebar( 
    156156    '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 
    157157    '<p>' . __( '<a href="http://codex.wordpress.org/Media_Library_Screen" target="_blank">Documentation on Media Library</a>' ) . '</p>' . 
  • trunk/wp-admin/user-edit.php

    r19111 r19119  
    4646); 
    4747 
    48 get_current_screen()->add_help_sidebar( 
     48get_current_screen()->set_help_sidebar( 
    4949    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    5050    '<p>' . __('<a href="http://codex.wordpress.org/Users_Your_Profile_Screen" target="_blank">Documentation on User Profiles</a>') . '</p>' . 
  • trunk/wp-admin/user-new.php

    r19111 r19119  
    147147); 
    148148 
    149 get_current_screen()->add_help_sidebar( 
     149get_current_screen()->set_help_sidebar( 
    150150    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    151151    '<p>' . __('<a href="http://codex.wordpress.org/Users_Add_New_Screen" target="_blank">Documentation on Adding New Users</a>') . '</p>' . 
  • trunk/wp-admin/users.php

    r19111 r19119  
    2727); 
    2828 
    29 get_current_screen()->add_help_sidebar( 
     29get_current_screen()->set_help_sidebar( 
    3030    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    3131    '<p>' . __('<a href="http://codex.wordpress.org/Users_Screen" target="_blank">Documentation on Managing Users</a>') . '</p>' . 
  • trunk/wp-admin/widgets.php

    r19111 r19119  
    4747add_contextual_help($current_screen, $help); 
    4848 
    49 get_current_screen()->add_help_sidebar( 
     49get_current_screen()->set_help_sidebar( 
    5050    '<p><strong>' . __('For more information:') . '</strong></p>' . 
    5151    '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_Screen" target="_blank">Documentation on Widgets</a>') . '</p>' . 
Note: See TracChangeset for help on using the changeset viewer.