WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/06/2008 10:21:27 PM (13 years ago)
Author:
ryan
Message:

screen_meta() fixes. Show Help on more pages.

File:
1 edited

Legend:

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

    r9556 r9557  
    823823            return apply_filters('manage_users_columns', $columns);
    824824        default :
    825             return apply_filters('manage_' . $page . '_columns', $columns);
    826     }
    827 
    828     return $columns;
     825            return apply_filters('manage_' . $page . '_columns', array());
     826    }
    829827}
    830828
     
    31233121}
    31243122
    3125 function screen_meta($screen, $metabox = false, $page = '') {
     3123function screen_meta($screen) {
     3124    global $wp_meta_boxes;
     3125
     3126    $column_screens = array('edit-posts' => 'post', 'edit-pages' => 'page', 'edit-tags' => 'tag', 'edit-categories' => 'category',
     3127        'edit-link-categories' => 'link-category', 'edit-links' => 'link', 'edit-users' => 'user', 'edit-media' => 'media',
     3128        'edit-comments' => 'comment');
     3129
     3130    $show_screen = false;
     3131    if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens[$screen]) )
     3132        $show_screen = true;
    31263133?>
    31273134<div id="screen-meta">
     3135<?php
     3136    if ( $show_screen ) :
     3137?>
    31283138<div id="screen-options-wrap" class="hidden">
    31293139    <h5><?php _e('Show on screen') ?></h5>
     
    31313141    <div class="metabox-prefs">
    31323142<?php
    3133     if ( $metabox ) {
    3134         meta_box_prefs($screen);
    3135     } else {
    3136         manage_columns_prefs($screen);
     3143    if ( !meta_box_prefs($screen) ) {
     3144        manage_columns_prefs($column_screens[$screen]);
    31373145        wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false );
    31383146    }
     
    31433151
    31443152<?php
    3145     if ( '' != $page ) {
    3146 // Allow a plugin to short-circuit
    3147         $help = apply_filters('contextual_help', '', $page);
    3148         if ( !empty($help) )
    3149             return;
    3150    
    3151         global $title;
    3152 
    3153         $help['edit-post'] =  __('<a href="http://codex.wordpress.org/Writing_Posts" target="_blank">Writing Posts</a>');
    3154         $help['general-settings'] =  __('<a href="http://codex.wordpress.org/Settings_General_SubPanel" target="_blank">General Settings</a>');
     3153    endif;
     3154
     3155    global $title;
     3156
     3157    $help['post'] =  __('<a href="http://codex.wordpress.org/Writing_Posts" target="_blank">Writing Posts</a>');
     3158    $help['general-settings'] =  __('<a href="http://codex.wordpress.org/Settings_General_SubPanel" target="_blank">General Settings</a>');
    31553159    ?>
    31563160    <div id="contextual-help-wrap" class="hidden">
    31573161    <?php
    3158         if ( isset($help[$page]) ) {
    3159             if ( isset($title) && 'edit-post' != $page )
     3162    if ( !apply_filters('contextual_help', '', $screen) ) {
     3163        if ( isset($help[$screen]) ) {
     3164            if ( isset($title) )
    31603165                echo '<h5>' . sprintf(__('Get help with "%s"'), $title) . '</h5>';
    31613166            else
    31623167                echo '<h5>' . __('Get help with this page') . '</h5>';
    3163             echo '<div class="metabox-prefs">' . $help[$page] . "</div>\n";
     3168            echo '<div class="metabox-prefs">' . $help[$screen] . "</div>\n";
    31643169   
    31653170            echo '<h5>' . __('Other Help') . '</h5>';
     
    31733178        _e('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>');
    31743179        echo "</div>\n";
     3180    }
    31753181    ?>
    31763182    </div>
    3177     <?php
    3178     }
    3179 ?>
    31803183
    31813184<div id="screen-meta-links">
    3182 <?php if ( '' != $page ) { ?>
    31833185<div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle">
    31843186<a href="#contextual-help" id="contextual-help-link" class="show-settings"><?php _e('Help') ?></a>
    31853187</div>
    3186 <?php } ?>
     3188<?php if ( $show_screen ) { ?>
    31873189<div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">
    31883190<a href="#screen-options" id="show-settings-link" class="show-settings"><?php _e('Screen Options') ?></a>
    31893191</div>
     3192<?php } ?>
    31903193</div>
    31913194</div>
Note: See TracChangeset for help on using the changeset viewer.