From 17881fddecb004303d4d8d87fa9e066d2251d0ab Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 18 Nov 2008 20:49:39 +0000 Subject: [PATCH] register_column_headers() git-svn-id: http://svn.automattic.com/wordpress/trunk@9763 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 51 ++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index a3fcce2581..3bafb79f6f 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -745,21 +745,24 @@ function wp_manage_pages_columns() { * @return unknown */ function get_column_headers($page) { - static $columns = array(); + global $_wp_column_headers; + + if ( !isset($_wp_column_headers) ) + $_wp_column_headers = array(); // Store in static to avoid running filters on each call - if ( isset($columns[$page]) ) - return $columns[$page]; + if ( isset($_wp_column_headers[$page]) ) + return $_wp_column_headers[$page]; switch ($page) { case 'edit': - $columns[$page] = wp_manage_posts_columns(); + $_wp_column_headers[$page] = wp_manage_posts_columns(); break; case 'edit-pages': - $columns[$page] = wp_manage_pages_columns(); + $_wp_column_headers[$page] = wp_manage_pages_columns(); break; case 'edit-comments': - $columns[$page] = array( + $_wp_column_headers[$page] = array( 'cb' => '', 'comment' => __('Comment'), 'author' => __('Author'), @@ -769,7 +772,7 @@ function get_column_headers($page) { break; case 'link-manager': - $columns[$page] = array( + $_wp_column_headers[$page] = array( 'cb' => '', 'name' => __('Name'), 'url' => __('URL'), @@ -780,10 +783,10 @@ function get_column_headers($page) { break; case 'upload': - $columns[$page] = wp_manage_media_columns(); + $_wp_column_headers[$page] = wp_manage_media_columns(); break; case 'categories': - $columns[$page] = array( + $_wp_column_headers[$page] = array( 'cb' => '', 'name' => __('Name'), 'description' => __('Description'), @@ -793,7 +796,7 @@ function get_column_headers($page) { break; case 'edit-link-categories': - $columns[$page] = array( + $_wp_column_headers[$page] = array( 'cb' => '', 'name' => __('Name'), 'description' => __('Description'), @@ -802,7 +805,7 @@ function get_column_headers($page) { break; case 'edit-tags': - $columns[$page] = array( + $_wp_column_headers[$page] = array( 'cb' => '', 'name' => __('Name'), 'slug' => __('Slug'), @@ -811,7 +814,7 @@ function get_column_headers($page) { break; case 'users': - $columns[$page] = array( + $_wp_column_headers[$page] = array( 'cb' => '', 'username' => __('Username'), 'name' => __('Name'), @@ -821,11 +824,11 @@ function get_column_headers($page) { ); break; default : - $columns[$page] = array(); + $_wp_column_headers[$page] = array(); } - $columns[$page] = apply_filters('manage_' . $page . '_columns', $columns[$page]); - return $columns[$page]; + $_wp_column_headers[$page] = apply_filters('manage_' . $page . '_columns', $_wp_column_headers[$page]); + return $_wp_column_headers[$page]; } /** @@ -870,6 +873,24 @@ function print_column_headers( $type, $id = true ) {