~robotparade/wordpress/stable

« back to all changes in this revision

Viewing changes to wp-admin/includes/template.php

  • Committer: Jeff Waugh
  • Date: 2010-06-11 21:00:40 UTC
  • Revision ID: jdub@bethesignal.org-20100611210040-9narx3kdlayc8x39
WordPress 3.0 RC3

Show diffs side-by-side

added added

removed removed

Lines of Context:
396
396
 * @return unknown
397
397
 */
398
398
function _tag_row( $tag, $level, $taxonomy = 'post_tag' ) {
399
 
                global $post_type;
 
399
                global $post_type, $current_screen;
400
400
                static $row_class = '';
401
401
                $row_class = ($row_class == '' ? ' class="alternate"' : '');
402
402
 
422
422
                $out .= '<tr id="tag-' . $tag->term_id . '"' . $row_class . '>';
423
423
 
424
424
 
425
 
                $columns = get_column_headers('edit-tags');
426
 
                $hidden = get_hidden_columns('edit-tags');
 
425
                $columns = get_column_headers($current_screen);
 
426
                $hidden = get_hidden_columns($current_screen);
427
427
                $default_term = get_option('default_' . $taxonomy);
428
428
                foreach ( $columns as $column_name => $column_display_name ) {
429
429
                        $class = "class=\"$column_name column-$column_name\"";
2965
2965
 * Show settings sections in your admin page callback function with do_settings_sections().
2966
2966
 * Add settings fields to your section with add_settings_field()
2967
2967
 *
2968
 
 * The $callback argument should be the name of a function that echos out any
 
2968
 * The $callback argument should be the name of a function that echoes out any
2969
2969
 * content you want to show at the top of the settings section before the actual
2970
2970
 * fields. It can output nothing if you want.
2971
2971
 *
2972
2972
 * @since 2.7.0
2973
2973
 *
2974
2974
 * @global $wp_settings_sections Storage array of all settings sections added to admin pages
2975
 
 
 
2975
 *
2976
2976
 * @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags.
2977
2977
 * @param string $title Formatted title of the section. Shown as the heading for the section.
2978
 
 * @param string $callback Function that echo's out content for the section heading.
2979
 
 * @param string $page The slug-name of the settings page on which to show the section (general, reading, writing, ...).
 
2978
 * @param string $callback Function that echos out any content at the top of the section (between heading and fields).
 
2979
 * @param string $page The slug-name of the settings page on which to show the section. Built-in pages include 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using add_options_page();
2980
2980
 */
2981
2981
function add_settings_section($id, $title, $callback, $page) {
2982
2982
        global $wp_settings_sections;
3748
3748
                        $per_page_label = $post_type_object->labels->name;
3749
3749
                        break;
3750
3750
                case 'ms-sites':
3751
 
                        $per_page_label = __('Sites');
 
3751
                        $per_page_label = _x( 'Sites', 'sites per page (screen options)' );
3752
3752
                        break;
3753
3753
                case 'ms-users':
3754
 
                        $per_page_label = __('Users');
 
3754
                        $per_page_label = _x( 'Users', 'users per page (screen options)' );
3755
3755
                        break;
3756
3756
                case 'edit-comments':
3757
 
                        $per_page_label = __('Comments');
 
3757
                        $per_page_label = _x( 'Comments', 'comments per page (screen options)' );
3758
3758
                        break;
3759
3759
                case 'upload':
3760
 
                        $per_page_label = __('Media items');
 
3760
                        $per_page_label = _x( 'Media items', 'items per page (screen options)' );
3761
3761
                        break;
3762
3762
                case 'edit-tags':
3763
3763
                        global $tax;
3764
3764
                        $per_page_label = $tax->labels->name;
3765
3765
                        break;
3766
3766
                case 'plugins':
3767
 
                        $per_page_label = __('Plugins');
 
3767
                        $per_page_label = _x( 'Plugins', 'plugins per page (screen options)' );
3768
3768
                        break;
3769
3769
                default:
3770
3770
                        return '';
3900
3900
 * @param string $id Screen id, optional.
3901
3901
 */
3902
3902
function set_current_screen( $id =  '' ) {
3903
 
        global $current_screen, $hook_suffix, $typenow;
 
3903
        global $current_screen, $hook_suffix, $typenow, $taxnow;
3904
3904
 
3905
3905
        if ( empty($id) ) {
3906
3906
                $current_screen = $hook_suffix;
3909
3909
                $current_screen = str_replace('-add', '', $current_screen);
3910
3910
                $current_screen = array('id' => $current_screen, 'base' => $current_screen);
3911
3911
        } else {
3912
 
                if ( false !== strpos($id, '-') )
 
3912
                $id = sanitize_key($id);
 
3913
                if ( false !== strpos($id, '-') ) {
3913
3914
                        list( $id, $typenow ) = explode('-', $id, 2);
 
3915
                        if ( is_taxonomy($typenow) ) {
 
3916
                                $id = 'edit-tags';
 
3917
                                $taxnow = $typenow;
 
3918
                                $typenow = '';
 
3919
                        }
 
3920
                }
3914
3921
                $current_screen = array('id' => $id, 'base' => $id);
3915
3922
        }
3916
3923
 
3932
3939
                        $typenow = 'post';
3933
3940
                $current_screen->id = $typenow;
3934
3941
                $current_screen->post_type = $typenow;
 
3942
        } elseif ( 'edit-tags' == $current_screen->id ) {
 
3943
                if ( empty($taxnow) )
 
3944
                        $taxnow = 'post_tag';
 
3945
                $current_screen->id = 'edit-' . $taxnow;
 
3946
                $current_screen->taxonomy = $taxnow;
3935
3947
        }
3936
3948
 
3937
3949
        $current_screen = apply_filters('current_screen', $current_screen);