WordPress.org

Make WordPress Core

Changeset 17293


Ignore:
Timestamp:
01/13/11 23:19:51 (3 years ago)
Author:
westi
Message:

The old methods are good enough in alot of cases where plugins want to extend simply. So un deprecate for now.

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

Legend:

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

    r16127 r17293  
    4141 
    4242/** WordPress List Table Administration API and base class */ 
     43require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php'); 
    4344require_once(ABSPATH . 'wp-admin/includes/list-table.php'); 
    44 require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php'); 
    4545 
    4646/** WordPress Theme Administration API */ 
  • trunk/wp-admin/includes/deprecated.php

    r17071 r17293  
    689689    return get_others_unpublished_posts($user_id, 'pending'); 
    690690} 
    691  
    692 /** 
    693  * Register column headers for a particular screen. 
    694  * 
    695  * @since 2.7.0 
    696  * @deprecated 3.1.0 
    697  * @deprecated Use WP_List_Table 
    698  * 
    699  * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions. 
    700  * @param array $columns An array of columns with column IDs as the keys and translated column names as the values 
    701  * @see get_column_headers(), print_column_headers(), get_hidden_columns() 
    702  */ 
    703 function register_column_headers($screen, $columns) { 
    704     _deprecated_function( __FUNCTION__, '3.1', 'WP_List_Table' ); 
    705  
    706     $wp_list_table = new _WP_List_Table_Compat($screen, $columns); 
    707 } 
    708  
    709 /** 
    710  * Prints column headers for a particular screen. 
    711  * 
    712  * @since 2.7.0 
    713  * @deprecated 3.1.0 
    714  * @deprecated Use WP_List_Table 
    715  */ 
    716 function print_column_headers($screen, $id = true) { 
    717     _deprecated_function( __FUNCTION__, '3.1', 'WP_List_Table' ); 
    718  
    719     $wp_list_table = new _WP_List_Table_Compat($screen); 
    720  
    721     $wp_list_table->print_column_headers($id); 
    722 } 
    723  
    724 /** 
    725  * Helper class to be used only by deprecated functions 
    726  * 
    727  * @since 3.1.0 
    728  */ 
    729 class _WP_List_Table_Compat extends WP_List_Table { 
    730     var $_screen; 
    731     var $_columns; 
    732  
    733     function _WP_List_Table_Compat( $screen, $columns = array() ) { 
    734         if ( is_string( $screen ) ) 
    735             $screen = convert_to_screen( $screen ); 
    736  
    737         $this->_screen = $screen; 
    738  
    739         if ( !empty( $columns ) ) { 
    740             $this->_columns = $columns; 
    741             add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 ); 
    742         } 
    743     } 
    744  
    745     function get_column_info() { 
    746         $columns = get_column_headers( $this->_screen ); 
    747         $hidden = get_hidden_columns( $this->_screen ); 
    748         $sortable = array(); 
    749  
    750         return array( $columns, $hidden, $sortable ); 
    751     } 
    752  
    753     function get_columns() { 
    754         return $this->_columns; 
    755     } 
    756 } 
    757  
  • trunk/wp-admin/includes/list-table.php

    r17070 r17293  
    6464} 
    6565 
     66/** 
     67 * Register column headers for a particular screen. 
     68 * 
     69 * @since 2.7.0 
     70 * 
     71 * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions. 
     72 * @param array $columns An array of columns with column IDs as the keys and translated column names as the values 
     73 * @see get_column_headers(), print_column_headers(), get_hidden_columns() 
     74 */ 
     75function register_column_headers($screen, $columns) { 
     76    $wp_list_table = new _WP_List_Table_Compat($screen, $columns); 
     77} 
     78 
     79/** 
     80 * Prints column headers for a particular screen. 
     81 * 
     82 * @since 2.7.0 
     83 */ 
     84function print_column_headers($screen, $id = true) { 
     85    $wp_list_table = new _WP_List_Table_Compat($screen); 
     86 
     87    $wp_list_table->print_column_headers($id); 
     88} 
     89 
     90/** 
     91 * Helper class to be used only by back compat functions 
     92 * 
     93 * @since 3.1.0 
     94 */ 
     95class _WP_List_Table_Compat extends WP_List_Table { 
     96    var $_screen; 
     97    var $_columns; 
     98 
     99    function _WP_List_Table_Compat( $screen, $columns = array() ) { 
     100        if ( is_string( $screen ) ) 
     101            $screen = convert_to_screen( $screen ); 
     102 
     103        $this->_screen = $screen; 
     104 
     105        if ( !empty( $columns ) ) { 
     106            $this->_columns = $columns; 
     107            add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 ); 
     108        } 
     109    } 
     110 
     111    function get_column_info() { 
     112        $columns = get_column_headers( $this->_screen ); 
     113        $hidden = get_hidden_columns( $this->_screen ); 
     114        $sortable = array(); 
     115 
     116        return array( $columns, $hidden, $sortable ); 
     117    } 
     118 
     119    function get_columns() { 
     120        return $this->_columns; 
     121    } 
     122} 
    66123?> 
Note: See TracChangeset for help on using the changeset viewer.