Changeset 18797 for trunk/wp-admin/includes/screen.php
- Timestamp:
- 09/28/2011 12:57:56 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/screen.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/screen.php
r18794 r18797 343 343 $contextual_help = ''; 344 344 if ( isset($_wp_contextual_help[$screen->id]) && is_array($_wp_contextual_help[$screen->id]) ) { 345 $contextual_help .= '<div class="metabox-prefs">' . "\n";346 345 347 346 /* … … 350 349 * Has no output so can only loop the array once 351 350 */ 352 $contextual_help_ tabs = ''; // store looped content for later351 $contextual_help_links = ''; // store looped content for later 353 352 $contextual_help_panels = ''; // store looped content for later 354 353 … … 356 355 357 356 foreach ( $_wp_contextual_help[$screen->id]['tabs'] as $tab ) { 358 $tab_slug = sanitize_html_class( $tab[ 0 ] ); 359 $contextual_help_tabs .= '<li class="tab-' . $tab_slug . ( ($tab_active) ? ' active' : '' ) . '">'; 360 $contextual_help_tabs .= '<a href="#' . $tab_slug . '">' . $tab[1] . '</a>'; 361 $contextual_help_tabs .= '</li>' ."\n"; 362 363 $contextual_help_panels .= '<div id="' . $tab_slug . '" class="help-tab-content' . ( ($tab_active) ? ' active' : '' ) . '">'; 364 $contextual_help_panels .= $tab[2]; 365 $contextual_help_panels .= "</div>\n"; 357 list( $id, $title, $content ) = $tab; 358 359 // Generate IDs 360 $id = sanitize_html_class( $id ); 361 $link_id = "tab-link-$id"; 362 $panel_id = "tab-panel-$id"; 363 364 $link_classes = ''; 365 $panel_classes = 'help-tab-content'; 366 367 if ( $tab_active ) { 368 $link_classes .= ' active'; 369 $panel_classes .= ' active'; 370 } 371 372 $link_classes = ( $tab_active ) ? 'active' : ''; 373 374 $contextual_help_links .= '<li id="' . esc_attr( $link_id ) . '" class="' . esc_attr( $link_classes ) . '">'; 375 $contextual_help_links .= '<a href="' . esc_url( "#$panel_id" ) . '">' . esc_html( $title ) . '</a>'; 376 $contextual_help_links .= '</li>'; 377 378 $contextual_help_panels .= '<div id="' . esc_attr( $panel_id ) . '" class="' . esc_attr( $panel_classes ) . '">'; 379 $contextual_help_panels .= '<h3>' . esc_html( $title ) . '</h3>'; 380 $contextual_help_panels .= $content; 381 $contextual_help_panels .= "</div>"; 366 382 367 383 $tab_active = false; … … 370 386 // Start output from loop: Tabbed help content 371 387 $contextual_help .= '<ul class="contextual-help-tabs">' . "\n"; 372 $contextual_help .= $contextual_help_ tabs;388 $contextual_help .= $contextual_help_links; 373 389 $contextual_help .= '</ul>' ."\n"; 390 391 // Sidebar to right of tabs 392 $contextual_help .= '<div class="contextual-help-sidebar">' . "\n"; 393 $contextual_help .= $_wp_contextual_help[$screen->id]['sidebar']; 394 $contextual_help .= "</div>\n"; 395 396 // Panel content 374 397 $contextual_help .= '<div class="contextual-help-tabs-wrap">' . "\n"; 375 398 $contextual_help .= $contextual_help_panels; 376 399 $contextual_help .= "</div>\n"; 377 // END: Tabbed help content 378 379 // Sidebar to right of tabs 380 $contextual_help .= '<div class="contextual-help-links">' . "\n"; 381 $contextual_help .= $_wp_contextual_help[$screen->id]['sidebar']; 382 $contextual_help .= "</div>\n"; 383 384 $contextual_help .= "</div>\n"; // end metabox 385 386 } elseif ( isset($_wp_contextual_help[$screen->id]) ) { 387 $contextual_help .= '<div class="metabox-prefs">' . $_wp_contextual_help[$screen->id] . "</div>\n"; 400 401 } elseif ( isset( $_wp_contextual_help[ $screen->id ] ) ) { 402 $contextual_help .= $_wp_contextual_help[ $screen->id ]; 403 388 404 } else { 389 $contextual_help .= '<div class="metabox-prefs">'; 390 $default_help = __('<a href="http://codex.wordpress.org/" target="_blank">Documentation</a>'); 405 $default_help = __( '<a href="http://codex.wordpress.org/" target="_blank">Documentation</a>' ); 391 406 $default_help .= '<br />'; 392 $default_help .= __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>'); 393 $contextual_help .= apply_filters('default_contextual_help', $default_help); 394 $contextual_help .= '</div>' . "\n"; 395 } 407 $default_help .= __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ); 408 409 $contextual_help .= apply_filters( 'default_contextual_help', $default_help ); 410 } 411 412 $contextual_help = "<div class='metabox-prefs'>$contextual_help</div>"; 396 413 397 414 echo apply_filters('contextual_help', $contextual_help, $screen->id, $screen); … … 407 424 * The array $help takes the following format: 408 425 * array( 'contextual-help-tabs' => array( $tab1_title => $tab1_value [, $tab2_title => $tab2_value, ...] ), 409 * 'contextual-help- links' => $help_links_as_string )426 * 'contextual-help-sidebar' => $help_links_as_string ) 410 427 * 411 428 * For backwards compatability, a string is also accepted. … … 692 709 /** 693 710 * Constructor 694 * 711 * 695 712 * @since 3.3.0 696 713 * … … 777 794 * Adds an option for the screen. 778 795 * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add screen options. 779 * 796 * 780 797 * @since 3.3.0 781 798 * … … 790 807 * Add a help tab to the contextual help for the screen. 791 808 * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add contextual help tabs. 792 * 809 * 793 810 * @since 3.3.0 794 811 * … … 806 823 * Add a sidebar to the contextual help for the screen. 807 824 * 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. 808 * 825 * 809 826 * @since 3.3.0 810 827 *
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)