WordPress.org

Make WordPress Core

Ticket #18785: 18785.andrew-2nd.2.diff

File 18785.andrew-2nd.2.diff, 7.4 KB (added by mbijon, 3 years ago)

Updated use of existing add_help_tab() instances

  • wp-admin/edit-form-advanced.php

     
    189189        } 
    190190 
    191191        $current_screen->add_help_tab( array( 
     192                'id'      => 'publish-box', 
    192193                'title'   => __('Publish Box'), 
    193194                'content' => $publish_box, 
    194195        ) ); 
     
    197198        $discussion_settings .= '<p>' . __('<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '</p>'; 
    198199 
    199200        $current_screen->add_help_tab( array( 
     201                'id'      => 'discussion-settings', 
    200202                'title'   => __('Discussion Settings'), 
    201203                'content' => $discussion_settings, 
    202204        ) ); 
     
    208210                        '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 
    209211        ); 
    210212} elseif ( 'page' == $post_type ) { 
    211         $current_screen->add_help_tab( 'about-pages', __('About Pages'), '<p>' . __('Pages are similar to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the &#8220;Parent&#8221; of the other, creating a group of Pages.') . '</p>' . 
    212                                 '<p>' . __('Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the new in 3.2 distraction-free writing space, available in both the Visual and HTML modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box:') . '</p>' ); 
    213         $current_screen->add_help_tab('page-attributes', ('Page Attributes'), 
    214                                 '<p>' . __('<strong>Parent</strong> - You can arrange your pages in hierarchies. For example, you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how many levels you can nest pages.') . '</p>' . 
    215                                 '<p>' . __('<strong>Template</strong> - Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them in this dropdown menu.') . '</p>' . 
    216                                 '<p>' . __('<strong>Order</strong> - Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.') . '</p>' ); 
     213        $about_pages = '<p>' . __('Pages are similar to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the &#8220;Parent&#8221; of the other, creating a group of Pages.') . '</p>' . 
     214                '<p>' . __('Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the new in 3.2 distraction-free writing space, available in both the Visual and HTML modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box:') . '</p>'; 
     215         
     216        $current_screen->add_help_tab( array( 
     217                'id'      => 'about-pages', 
     218                'title'   => __('About Pages'), 
     219                'content' => $about_pages, 
     220        ) ); 
     221         
     222        $page_attributes = '<p>' . __('<strong>Parent</strong> - You can arrange your pages in hierarchies. For example, you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how many levels you can nest pages.') . '</p>' . 
     223                '<p>' . __('<strong>Template</strong> - Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them in this dropdown menu.') . '</p>' . 
     224                '<p>' . __('<strong>Order</strong> - Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.') . '</p>'; 
     225         
     226        $current_screen->add_help_tab( array( 
     227                'id' => 'page-attributes', 
     228                'title' => __('Page Attributes'), 
     229                'content' => $page_attributes, 
     230        ) ); 
     231         
    217232        $current_screen->add_help_sidebar( 
    218233                        '<p><strong>' . __('For more information:') . '</strong></p>' . 
    219234                        '<p>' . __('<a href="http://codex.wordpress.org/Pages_Add_New_Screen" target="_blank">Documentation on Adding New Pages</a>') . '</p>' . 
  • wp-admin/includes/screen.php

     
    590590         * 
    591591         * @param array $args 
    592592         * - string   - title    - Title for the tab. 
    593          * - string   - id       - Tab ID. Optional. 
     593         * - string   - id       - Tab ID. Must be HTML-safe. 
    594594         * - string   - content  - Help tab content in plain text or HTML. Optional. 
    595595         * - callback - callback - A callback to generate the tab content. Optional. 
    596596         * 
     
    608608                if ( ! $args['title'] ) 
    609609                        return; 
    610610 
    611                 // Create an id from the title if one is not provided. 
     611                // Ensure we have an id. 
    612612                if ( ! $args['id'] ) 
    613                         $args['id'] = sanitize_html_class( $args['title'] ); 
     613                        return; 
    614614 
    615615                $this->_help_tabs[] = $args; 
    616616        } 
     
    647647                        $contextual_help = apply_filters( 'contextual_help', $_wp_contextual_help[ $this->id ], $this->id, $this ); 
    648648 
    649649                        $this->add_help_tab( array( 
     650                                'id'      => 'contextual-help', 
    650651                                'title'   => __('Screen Info'), 
    651652                                'content' => $contextual_help, 
    652653                        ) ); 
     
    655656                // Add screen options tab 
    656657                if ( $this->show_screen_options() ) { 
    657658                        $this->add_help_tab( array( 
     659                                'id'       => 'screen-options', 
    658660                                'title'    => __('Screen Options'), 
    659661                                'callback' => array( $this, 'render_screen_options' ), 
    660662                        ) ); 
  • wp-admin/index.php

     
    3636$help_navigation .= '<p>' . __('Links in the &#8220;admin bar&#8221; at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.') . '</p>'; 
    3737 
    3838$current_screen->add_help_tab( array( 
     39        'id'      => 'help-navigation', 
    3940        'title'   => __('Navigation'), 
    4041        'content' => $help_navigation, 
    4142) ); 
     
    4647$help_layout .= '<p>' . __('<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some box have configurable content, and will show a &#8220;Configure&#8221; link in the title bar if you hover over it.') . '</p>'; 
    4748 
    4849$current_screen->add_help_tab( array( 
     50        'id'      => 'help-layout', 
    4951        'title'   => __('Layout'), 
    5052        'content' => $help_layout, 
    5153) ); 
     
    6163$help_content .= '<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>'; 
    6264 
    6365$current_screen->add_help_tab( array( 
     66        'id'      => 'help-content', 
    6467        'title'   => __('Content'), 
    6568        'content' => $help_content, 
    6669) );