WordPress.org

Make WordPress Core

Changeset 19520


Ignore:
Timestamp:
12/01/11 03:29:55 (6 years ago)
Author:
nacin
Message:

Deprecate add_contextual_help() for get_current_screen()->add_help_tab(). fixes #19020.

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

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

    r19420 r19520  
    860860    return wp_media_insert_url_form( 'file' ); 
    861861} 
     862 
     863/** 
     864 * Add contextual help text for a page. 
     865 * 
     866 * Creates an 'Overview' help tab. 
     867 * 
     868 * @since 2.7.0 
     869 * @deprecated 3.3.0 
     870 * @deprecated Use get_current_screen()->add_help_tab() 
     871 * @see WP_Screen 
     872 * 
     873 * @param string    $screen The handle for the screen to add help to.  This is usually the hook name returned by the add_*_page() functions. 
     874 * @param string    $help   The content of an 'Overview' help tab. 
     875 */ 
     876function add_contextual_help( $screen, $help ) { 
     877    _deprecated_function( __FUNCTION__, '3.3', 'get_current_screen()->add_help_tab()' ); 
     878 
     879    if ( is_string( $screen ) ) 
     880        $screen = convert_to_screen( $screen ); 
     881 
     882    WP_Screen::add_old_compat_help( $screen, $help ); 
     883} 
  • trunk/wp-admin/includes/screen.php

    r19503 r19520  
    106106 
    107107    return apply_filters( 'hidden_meta_boxes', $hidden, $screen, $use_defaults ); 
    108 } 
    109  
    110 /** 
    111  * Add contextual help text for a page. 
    112  * 
    113  * Creates an 'Overview' help tab. 
    114  * 
    115  * @since 2.7.0 
    116  * 
    117  * @param string    $screen The handle for the screen to add help to.  This is usually the hook name returned by the add_*_page() functions. 
    118  * @param string    $help   The content of an 'Overview' help tab. 
    119  * 
    120  * @todo: deprecate? 
    121  */ 
    122 function add_contextual_help( $screen, $help ) { 
    123     if ( is_string( $screen ) ) 
    124         $screen = convert_to_screen( $screen ); 
    125  
    126     WP_Screen::add_old_compat_help( $screen, $help ); 
    127108} 
    128109 
Note: See TracChangeset for help on using the changeset viewer.