From 93465db918d67b3aea63631bcf6fad7461e54bf5 Mon Sep 17 00:00:00 2001 From: westi Date: Thu, 13 Jan 2011 23:19:51 +0000 Subject: [PATCH] The old methods are good enough in alot of cases where plugins want to extend simply. So un deprecate for now. git-svn-id: http://svn.automattic.com/wordpress/trunk@17293 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/admin.php | 2 +- wp-admin/includes/deprecated.php | 67 -------------------------------- wp-admin/includes/list-table.php | 59 +++++++++++++++++++++++++++- 3 files changed, 59 insertions(+), 69 deletions(-) diff --git a/wp-admin/includes/admin.php b/wp-admin/includes/admin.php index 1849ed3f59..37f5c8ec9d 100644 --- a/wp-admin/includes/admin.php +++ b/wp-admin/includes/admin.php @@ -40,8 +40,8 @@ require_once(ABSPATH . 'wp-admin/includes/taxonomy.php'); require_once(ABSPATH . 'wp-admin/includes/template.php'); /** WordPress List Table Administration API and base class */ -require_once(ABSPATH . 'wp-admin/includes/list-table.php'); require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php'); +require_once(ABSPATH . 'wp-admin/includes/list-table.php'); /** WordPress Theme Administration API */ require_once(ABSPATH . 'wp-admin/includes/theme.php'); diff --git a/wp-admin/includes/deprecated.php b/wp-admin/includes/deprecated.php index 402abee96b..b91c64fc77 100644 --- a/wp-admin/includes/deprecated.php +++ b/wp-admin/includes/deprecated.php @@ -688,70 +688,3 @@ function get_others_pending($user_id) { return get_others_unpublished_posts($user_id, 'pending'); } - -/** - * Register column headers for a particular screen. - * - * @since 2.7.0 - * @deprecated 3.1.0 - * @deprecated Use WP_List_Table - * - * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions. - * @param array $columns An array of columns with column IDs as the keys and translated column names as the values - * @see get_column_headers(), print_column_headers(), get_hidden_columns() - */ -function register_column_headers($screen, $columns) { - _deprecated_function( __FUNCTION__, '3.1', 'WP_List_Table' ); - - $wp_list_table = new _WP_List_Table_Compat($screen, $columns); -} - -/** - * Prints column headers for a particular screen. - * - * @since 2.7.0 - * @deprecated 3.1.0 - * @deprecated Use WP_List_Table - */ -function print_column_headers($screen, $id = true) { - _deprecated_function( __FUNCTION__, '3.1', 'WP_List_Table' ); - - $wp_list_table = new _WP_List_Table_Compat($screen); - - $wp_list_table->print_column_headers($id); -} - -/** - * Helper class to be used only by deprecated functions - * - * @since 3.1.0 - */ -class _WP_List_Table_Compat extends WP_List_Table { - var $_screen; - var $_columns; - - function _WP_List_Table_Compat( $screen, $columns = array() ) { - if ( is_string( $screen ) ) - $screen = convert_to_screen( $screen ); - - $this->_screen = $screen; - - if ( !empty( $columns ) ) { - $this->_columns = $columns; - add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 ); - } - } - - function get_column_info() { - $columns = get_column_headers( $this->_screen ); - $hidden = get_hidden_columns( $this->_screen ); - $sortable = array(); - - return array( $columns, $hidden, $sortable ); - } - - function get_columns() { - return $this->_columns; - } -} - diff --git a/wp-admin/includes/list-table.php b/wp-admin/includes/list-table.php index 5b36969f1a..cd918ed902 100644 --- a/wp-admin/includes/list-table.php +++ b/wp-admin/includes/list-table.php @@ -63,4 +63,61 @@ function require_list_table( $class ) { return false; } -?> +/** + * Register column headers for a particular screen. + * + * @since 2.7.0 + * + * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions. + * @param array $columns An array of columns with column IDs as the keys and translated column names as the values + * @see get_column_headers(), print_column_headers(), get_hidden_columns() + */ +function register_column_headers($screen, $columns) { + $wp_list_table = new _WP_List_Table_Compat($screen, $columns); +} + +/** + * Prints column headers for a particular screen. + * + * @since 2.7.0 + */ +function print_column_headers($screen, $id = true) { + $wp_list_table = new _WP_List_Table_Compat($screen); + + $wp_list_table->print_column_headers($id); +} + +/** + * Helper class to be used only by back compat functions + * + * @since 3.1.0 + */ +class _WP_List_Table_Compat extends WP_List_Table { + var $_screen; + var $_columns; + + function _WP_List_Table_Compat( $screen, $columns = array() ) { + if ( is_string( $screen ) ) + $screen = convert_to_screen( $screen ); + + $this->_screen = $screen; + + if ( !empty( $columns ) ) { + $this->_columns = $columns; + add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 ); + } + } + + function get_column_info() { + $columns = get_column_headers( $this->_screen ); + $hidden = get_hidden_columns( $this->_screen ); + $sortable = array(); + + return array( $columns, $hidden, $sortable ); + } + + function get_columns() { + return $this->_columns; + } +} +?> \ No newline at end of file