WordPress.org

Make WordPress Core

Ticket #19342: 19342.diff

File 19342.diff, 1.6 KB (added by nacin, 3 years ago)
  • wp-admin/includes/template.php

     
    17951795        } 
    17961796} 
    17971797 
    1798 add_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) ); 
    1799  No newline at end of file 
     1798add_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) ); 
     1799 
     1800 
     1801/** 
     1802 * Convert a screen string to a screen object 
     1803 * 
     1804 * @since 3.0.0 
     1805 * 
     1806 * @param string $hook_name The hook name (also known as the hook suffix) used to determine the screen. 
     1807 * @return WP_Screen Screen object. 
     1808 */ 
     1809function convert_to_screen( $hook_name ) { 
     1810        if ( ! is_admin() ) 
     1811                _doing_it_wrong( "Do not include wp-admin/includes/template.php directly. You're giving the core developers a heart attack." ); 
     1812                return (object) array( 'id' => $hook_name, 'base' => $hook_name ); 
     1813        } 
     1814        return WP_Screen::get( $hook_name ); 
     1815} 
     1816 No newline at end of file 
  • wp-admin/includes/screen.php

     
    108108} 
    109109 
    110110/** 
    111  * Convert a screen string to a screen object 
    112  * 
    113  * @since 3.0.0 
    114  * 
    115  * @param string $hook_name The hook name (also known as the hook suffix) used to determine the screen. 
    116  * @return WP_Screen Screen object. 
    117  */ 
    118 function convert_to_screen( $hook_name ) { 
    119         return WP_Screen::get( $hook_name ); 
    120 } 
    121  
    122 /** 
    123111 * Add contextual help text for a page. 
    124112 * 
    125113 * Creates a 'Screen Info' help tab.