Changeset 18941 for trunk/wp-admin/includes/screen.php
- Timestamp:
- 10/11/2011 07:29:09 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/screen.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/screen.php
r18915 r18941 591 591 * @param array $args 592 592 * - string - title - Title for the tab. 593 * - string - id - Tab ID. Optional.593 * - string - id - Tab ID. Must be HTML-safe. 594 594 * - string - content - Help tab content in plain text or HTML. Optional. 595 595 * - callback - callback - A callback to generate the tab content. Optional. … … 605 605 $args = wp_parse_args( $args, $defaults ); 606 606 607 // Ensure we have a title. 608 if ( ! $args['title'] ) 607 $args['id'] = sanitize_html_class( $args['id'] ); 608 609 // Ensure we have an ID and title. 610 if ( ! $args['id'] || ! $args['title'] ) 609 611 return; 610 611 // Create an id from the title if one is not provided.612 if ( ! $args['id'] )613 $args['id'] = sanitize_html_class( $args['title'] );614 612 615 613 $this->_help_tabs[] = $args; … … 643 641 $_wp_contextual_help = apply_filters( 'contextual_help_list', $_wp_contextual_help, $this ); 644 642 645 if ( isset( $_wp_contextual_help[ $this->id ] ) ) {643 if ( isset( $_wp_contextual_help[ $this->id ] ) || ! $this->_help_tabs ) { 646 644 // Call old contextual_help filter. 647 $contextual_help = apply_filters( 'contextual_help', $_wp_contextual_help[ $this->id ], $this->id, $this ); 645 if ( isset( $_wp_contextual_help[ $this->id ] ) ) 646 $contextual_help = apply_filters( 'contextual_help', $_wp_contextual_help[ $this->id ], $this->id, $this ); 647 648 if ( empty( $contextual_help ) ) { 649 $default_help = __( '<a href="http://codex.wordpress.org/" target="_blank">Documentation</a>' ); 650 $default_help .= '<br />'; 651 $default_help .= __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ); 652 $contextual_help = '<p>' . apply_filters( 'default_contextual_help', $default_help ) . '</p>'; 653 } 648 654 649 655 $this->add_help_tab( array( 656 'id' => 'contextual-help', 650 657 'title' => __('Screen Info'), 651 658 'content' => $contextual_help, … … 656 663 if ( $this->show_screen_options() ) { 657 664 $this->add_help_tab( array( 665 'id' => 'screen-options', 658 666 'title' => __('Screen Options'), 659 667 'callback' => array( $this, 'render_screen_options' ),
Note: See TracChangeset
for help on using the changeset viewer.