Changeset 18911
- Timestamp:
- 10/07/2011 04:57:12 AM (13 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/wp-admin.dev.css
r18910 r18911 1514 1514 #screen-options-wrap h5, 1515 1515 #contextual-help-wrap h5 { 1516 margin: 12px 0 2px;1516 margin: 8px 0; 1517 1517 font-size: 13px; 1518 1518 } 1519 1519 1520 1520 .metabox-prefs label { 1521 display: inline-block; 1521 1522 padding-right: 15px; 1522 1523 white-space: nowrap; 1524 line-height: 30px; 1523 1525 } 1524 1526 -
trunk/wp-admin/edit-comments.php
r18867 r18911 110 110 $title = __('Comments'); 111 111 112 $current_screen->add_option( 'per_page', array('label' => _x( 'Comments', 'comments per page (screen options)' )) ); 113 $current_screen->add_option_context( '<p>test</p>' ); 112 add_screen_option( 'per_page', array('label' => _x( 'Comments', 'comments per page (screen options)' )) ); 114 113 115 114 add_contextual_help( $current_screen, '<p>' . __( 'You can manage comments made on your site similar to the way you manage Posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '</p>' . -
trunk/wp-admin/edit-form-advanced.php
r18892 r18911 159 159 do_action('do_meta_boxes', $post_type, 'side', $post); 160 160 161 $current_screen->add_option('layout_columns', array('max' => 2, 'default' => 2) ); 162 163 $current_screen->add_option_context( 164 '<p>test</p>' 165 ); 161 add_screen_option('layout_columns', array('max' => 2, 'default' => 2) ); 166 162 167 163 if ( 'post' == $post_type ) { … … 171 167 'id' => 'customize-display', 172 168 'title' => __('Customizing This Display'), 173 'content' => $customize_display 169 'content' => $customize_display, 174 170 ) ); 175 171 -
trunk/wp-admin/edit-link-form.php
r18889 r18911 38 38 do_action('do_meta_boxes', 'link', 'side', $link); 39 39 40 $current_screen->add_option('layout_columns', array('max' => 2, 'default' => 2) );40 add_screen_option('layout_columns', array('max' => 2, 'default' => 2) ); 41 41 42 $current_screen->add_option_context( 43 '<p>test</p>' 42 add_contextual_help($current_screen, 43 '<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' . 44 '<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' . 45 '<p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/" target="_blank">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>' . 46 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 47 '<p>' . __( '<a href="http://codex.wordpress.org/Links_Add_New_Screen" target="_blank">Documentation on Creating Links</a>' ) . '</p>' . 48 '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' 44 49 ); 45 46 add_contextual_help( $current_screen, '47 <p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>48 <p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>49 <p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/" target="_blank">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>50 <p><strong>' . __( 'For more information:' ) . '</strong></p>51 <p>' . __( '<a href="http://codex.wordpress.org/Links_Add_New_Screen" target="_blank">Documentation on Creating Links</a>' ) . '</p>52 <p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' );53 50 54 51 require_once ('admin-header.php'); -
trunk/wp-admin/edit-tags.php
r18867 r18911 29 29 } 30 30 31 $current_screen->add_option( 'per_page', array('label' => $title, 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page') ); 32 33 $current_screen->add_option_context( 34 '<p>test</p>' 35 ); 31 add_screen_option( 'per_page', array('label' => $title, 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page') ); 36 32 37 33 switch ( $wp_list_table->current_action() ) { -
trunk/wp-admin/edit.php
r18867 r18911 148 148 149 149 $title = $post_type_object->labels->name; 150 151 $current_screen->add_option( 'per_page', array('label' => $title, 'default' => 20) );152 $current_screen->add_option_context( '<p>test</p>' );153 150 154 151 if ( 'post' == $post_type ) { … … 184 181 } 185 182 183 add_screen_option( 'per_page', array('label' => $title, 'default' => 20) ); 184 186 185 require_once('./admin-header.php'); 187 186 ?> -
trunk/wp-admin/includes/deprecated.php
r18904 r18911 802 802 */ 803 803 function screen_meta( $screen ) { 804 _deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_screen_meta()' );805 806 804 $current_screen = get_current_screen(); 807 805 $current_screen->render_screen_meta(); 808 806 } 809 810 /**811 * {@internal Missing Short Description}}812 *813 * @since 2.7.0814 * @deprecated 3.3.0815 */816 function favorite_actions() {817 _deprecated_function( __FUNCTION__, '3.3' );818 }819 820 /**821 * Old way of adding contextual help text for a page. Use:822 * $current_screen->add_help_tab( array(823 * 'id' => 'my-id', // required824 * 'title' => __('My Tab'), // required825 * 'content' => 'help html'826 * ));827 *828 * Creates a 'Screen Info' help tab.829 *830 * @since 2.7.0831 * @deprecated 3.3.0832 *833 * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.834 * @param string $help The content of a 'Screen Info' help tab.835 */836 function add_contextual_help($screen, $help) {837 //_deprecated_function( __FUNCTION__, '3.3', '$current_screen->add_help_tab()' );838 839 global $_wp_contextual_help;840 841 if ( is_string($screen) )842 $screen = convert_to_screen($screen);843 844 if ( !isset($_wp_contextual_help) )845 $_wp_contextual_help = array();846 847 $_wp_contextual_help[$screen->id] = $help;848 }849 850 /**851 * Old way of registering and configuring an admin screen option. Use $current_screen->add_option().852 *853 * @since 3.1.0854 * @deprecated 3.3.0855 *856 * @param string $option An option name.857 * @param mixed $args Option dependent arguments858 * @return void859 */860 function add_screen_option( $option, $args = array() ) {861 //_deprecated_function( __FUNCTION__, '3.3', '$current_screen->add_option()' );862 863 $current_screen = get_current_screen();864 865 if ( ! $current_screen )866 return;867 868 return $current_screen->add_option( $option, $args );869 }870 871 /**872 * Output the HTML for hiding metaboxes on the page, use $current_screen->render_metabox_prefs().873 *874 * Note that the outputted HTML contains the H5 heading and the DIV class="metabox-prefs".875 *876 * @since 2.7.0877 * @deprecated 3.3.0878 *879 * @param mixed $screen880 */881 function meta_box_prefs($screen) {882 //_deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_metabox_prefs()' );883 884 $current_screen = get_current_screen();885 886 if ( ! $current_screen )887 return;888 889 return $current_screen->render_metabox_prefs();890 }891 892 function get_screen_icon( $screen = '' ) {893 //_deprecated_function( __FUNCTION__, '3.3', '$current_screen->get_screen_icon()' );894 895 $current_screen = get_current_screen();896 897 if ( ! $current_screen )898 return;899 900 return $current_screen->get_screen_icon($screen);901 }902 903 -
trunk/wp-admin/includes/screen.php
r18896 r18911 15 15 * @return array Containing the headers in the format id => UI String 16 16 */ 17 function get_column_headers( $screen ) { // TODO: fold into WP_Screen?17 function get_column_headers( $screen ) { 18 18 if ( is_string( $screen ) ) 19 19 $screen = convert_to_screen( $screen ); … … 36 36 * @return array 37 37 */ 38 function get_hidden_columns( $screen ) { // TODO: fold into WP_Screen38 function get_hidden_columns( $screen ) { 39 39 if ( is_string( $screen ) ) 40 40 $screen = convert_to_screen( $screen ); … … 44 44 45 45 /** 46 * {@internal Missing Short Description}} 47 * 48 * @since 2.7.0 49 * 50 * @param unknown_type $screen 51 */ 52 function meta_box_prefs($screen) { 53 global $wp_meta_boxes; 54 55 if ( is_string($screen) ) 56 $screen = convert_to_screen($screen); 57 58 if ( empty($wp_meta_boxes[$screen->id]) ) 59 return; 60 61 $hidden = get_hidden_meta_boxes($screen); 62 63 foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) { 64 foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) { 65 foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) { 66 if ( false == $box || ! $box['title'] ) 67 continue; 68 // Submit box cannot be hidden 69 if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] ) 70 continue; 71 $box_id = $box['id']; 72 echo '<label for="' . $box_id . '-hide">'; 73 echo '<input class="hide-postbox-tog" name="' . $box_id . '-hide" type="checkbox" id="' . $box_id . '-hide" value="' . $box_id . '"' . (! in_array($box_id, $hidden) ? ' checked="checked"' : '') . ' />'; 74 echo "{$box['title']}</label>\n"; 75 } 76 } 77 } 78 } 79 80 /** 46 81 * Get Hidden Meta Boxes 47 82 * … … 51 86 * @return array Hidden Meta Boxes 52 87 */ 53 function get_hidden_meta_boxes( $screen ) { // TODO: fold into WP_Screen88 function get_hidden_meta_boxes( $screen ) { 54 89 if ( is_string( $screen ) ) 55 90 $screen = convert_to_screen( $screen ); … … 63 98 else 64 99 $hidden = array( 'slugdiv' ); 65 66 100 $hidden = apply_filters('default_hidden_meta_boxes', $hidden, $screen); 67 101 } 68 102 69 103 return $hidden; 104 } 105 106 /** 107 * {@internal Missing Short Description}} 108 * 109 * @since 2.7.0 110 */ 111 function favorite_actions( $screen = null ) { 112 $default_action = false; 113 114 if ( is_string($screen) ) 115 $screen = convert_to_screen($screen); 116 117 if ( $screen->is_user ) 118 return; 119 120 if ( isset($screen->post_type) ) { 121 $post_type_object = get_post_type_object($screen->post_type); 122 if ( 'add' != $screen->action ) 123 $default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object->cap->edit_posts)); 124 else 125 $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->name, $post_type_object->cap->edit_posts)); 126 } 127 128 if ( !$default_action ) { 129 if ( $screen->is_network ) { 130 $default_action = array('sites.php' => array( __('Sites'), 'manage_sites')); 131 } else { 132 switch ( $screen->id ) { 133 case 'upload': 134 $default_action = array('media-new.php' => array(__('New Media'), 'upload_files')); 135 break; 136 case 'media': 137 $default_action = array('upload.php' => array(__('Edit Media'), 'upload_files')); 138 break; 139 case 'link-manager': 140 case 'link': 141 if ( 'add' != $screen->action ) 142 $default_action = array('link-add.php' => array(__('New Link'), 'manage_links')); 143 else 144 $default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links')); 145 break; 146 case 'users': 147 $default_action = array('user-new.php' => array(__('New User'), 'create_users')); 148 break; 149 case 'user': 150 $default_action = array('users.php' => array(__('Edit Users'), 'edit_users')); 151 break; 152 case 'plugins': 153 $default_action = array('plugin-install.php' => array(__('Install Plugins'), 'install_plugins')); 154 break; 155 case 'plugin-install': 156 $default_action = array('plugins.php' => array(__('Manage Plugins'), 'activate_plugins')); 157 break; 158 case 'themes': 159 $default_action = array('theme-install.php' => array(__('Install Themes'), 'install_themes')); 160 break; 161 case 'theme-install': 162 $default_action = array('themes.php' => array(__('Manage Themes'), 'switch_themes')); 163 break; 164 default: 165 $default_action = array('post-new.php' => array(__('New Post'), 'edit_posts')); 166 break; 167 } 168 } 169 } 170 171 if ( !$screen->is_network ) { 172 $actions = array( 173 'post-new.php' => array(__('New Post'), 'edit_posts'), 174 'edit.php?post_status=draft' => array(__('Drafts'), 'edit_posts'), 175 'post-new.php?post_type=page' => array(__('New Page'), 'edit_pages'), 176 'media-new.php' => array(__('Upload'), 'upload_files'), 177 'edit-comments.php' => array(__('Comments'), 'moderate_comments') 178 ); 179 } else { 180 $actions = array( 181 'sites.php' => array( __('Sites'), 'manage_sites'), 182 'users.php' => array( __('Users'), 'manage_network_users') 183 ); 184 } 185 186 $default_key = array_keys($default_action); 187 $default_key = $default_key[0]; 188 if ( isset($actions[$default_key]) ) 189 unset($actions[$default_key]); 190 $actions = array_merge($default_action, $actions); 191 $actions = apply_filters( 'favorite_actions', $actions, $screen ); 192 193 $allowed_actions = array(); 194 foreach ( $actions as $action => $data ) { 195 if ( current_user_can($data[1]) ) 196 $allowed_actions[$action] = $data[0]; 197 } 198 199 if ( empty($allowed_actions) ) 200 return; 201 202 $first = array_keys($allowed_actions); 203 $first = $first[0]; 204 echo '<div id="favorite-actions">'; 205 echo '<div id="favorite-first"><a href="' . $first . '">' . $allowed_actions[$first] . '</a></div><div id="favorite-toggle"><br /></div>'; 206 echo '<div id="favorite-inside">'; 207 208 array_shift($allowed_actions); 209 210 foreach ( $allowed_actions as $action => $label) { 211 echo "<div class='favorite-action'><a href='$action'>"; 212 echo $label; 213 echo "</a></div>\n"; 214 } 215 echo "</div></div>\n"; 70 216 } 71 217 … … 78 224 * @return object An object containing the safe screen name and id 79 225 */ 80 function convert_to_screen( $screen ) { // TODO: fold into WP_Screen?226 function convert_to_screen( $screen ) { 81 227 $screen = str_replace( array('.php', '-new', '-add', '-network', '-user' ), '', $screen); 82 228 … … 86 232 $screen .= '-user'; 87 233 88 // why do we need this?$screen = (string) apply_filters( 'screen_meta_screen', $screen );234 $screen = (string) apply_filters( 'screen_meta_screen', $screen ); 89 235 $screen = (object) array('id' => $screen, 'base' => $screen); 90 236 return $screen; 91 237 } 92 238 93 function screen_icon( $for = '' ) { // TODO: fold into WP_Screen? 94 global $current_screen; 95 96 if ( !isset($current_screen) ) 239 /** 240 * Add contextual help text for a page. 241 * 242 * Creates a 'Screen Info' help tab. 243 * 244 * @since 2.7.0 245 * 246 * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions. 247 * @param string $help The content of a 'Screen Info' help tab. 248 * 249 * @todo: deprecate? 250 */ 251 function add_contextual_help($screen, $help) { 252 global $_wp_contextual_help; 253 254 if ( is_string($screen) ) 255 $screen = convert_to_screen($screen); 256 257 if ( !isset($_wp_contextual_help) ) 258 $_wp_contextual_help = array(); 259 260 $_wp_contextual_help[$screen->id] = $help; 261 } 262 263 /** 264 * Register and configure an admin screen option 265 * 266 * @since 3.1.0 267 * 268 * @param string $option An option name. 269 * @param mixed $args Option dependent arguments 270 * @return void 271 */ 272 function add_screen_option( $option, $args = array() ) { 273 $current_screen = get_current_screen(); 274 275 if ( ! $current_screen ) 97 276 return; 98 277 99 echo $current_screen->get_screen_icon( $for ); 278 return $current_screen->add_option( $option, $args ); 279 } 280 281 function screen_icon( $screen = '' ) { 282 echo get_screen_icon( $screen ); 283 } 284 285 function get_screen_icon( $screen = '' ) { 286 global $current_screen, $typenow; 287 288 if ( empty($screen) ) 289 $screen = $current_screen; 290 elseif ( is_string($screen) ) 291 $name = $screen; 292 293 $class = 'icon32'; 294 295 if ( empty($name) ) { 296 if ( !empty($screen->parent_base) ) 297 $name = $screen->parent_base; 298 else 299 $name = $screen->base; 300 301 if ( 'edit' == $name && isset($screen->post_type) && 'page' == $screen->post_type ) 302 $name = 'edit-pages'; 303 304 $post_type = ''; 305 if ( isset( $screen->post_type ) ) 306 $post_type = $screen->post_type; 307 elseif ( $current_screen == $screen ) 308 $post_type = $typenow; 309 if ( $post_type ) 310 $class .= ' ' . sanitize_html_class( 'icon32-posts-' . $post_type ); 311 } 312 313 return '<div id="icon-' . esc_attr( $name ) . '" class="' . $class . '"><br /></div>'; 100 314 } 101 315 … … 125 339 * @param string $id Screen id, optional. 126 340 */ 127 function set_current_screen( $id = '' ) {341 function set_current_screen( $id = '' ) { 128 342 global $current_screen; 129 343 130 if ( !is_a( $current_screen, 'WP_Screen' ) ) 131 $current_screen = new WP_Screen( $id ); 132 133 // why do we need this? $current_screen = apply_filters('current_screen', $current_screen); 344 $current_screen = new WP_Screen( $id ); 345 346 $current_screen = apply_filters('current_screen', $current_screen); 134 347 } 135 348 … … 252 465 * @access private 253 466 */ 254 private $_options = array( 255 '_context' => '', 256 '_screen_settings' => '' 257 ); 258 259 /** 260 * Show screen options if any. 467 private $_options = array(); 468 469 470 /** 471 * Stores the result of the public show_screen_options function. 261 472 * 262 473 * @since 3.3.0 … … 264 475 * @access private 265 476 */ 266 private $_show_options = false; 477 private $_show_screen_options; 478 479 /** 480 * Stores the 'screen_settings' section of screen options. 481 * 482 * @since 3.3.0 483 * @var string 484 * @access private 485 */ 486 private $_screen_settings; 267 487 268 488 /** … … 281 501 $screen = $hook_suffix; 282 502 $screen = str_replace('.php', '', $screen); 283 284 503 if ( preg_match('/-add|-new$/', $screen) ) 285 504 $action = 'add'; 286 287 505 $screen = str_replace('-new', '', $screen); 288 506 $screen = str_replace('-add', '', $screen); … … 290 508 } else { 291 509 $id = sanitize_key( $id ); 292 293 510 if ( false !== strpos($id, '-') ) { 294 511 list( $id, $typenow ) = explode('-', $id, 2); 295 296 512 if ( taxonomy_exists( $typenow ) ) { 297 513 $id = 'edit-tags'; … … 308 524 if ( 'index' == $this->base ) 309 525 $this->base = 'dashboard'; 310 311 526 if ( 'index' == $this->id ) 312 527 $this->id = 'dashboard'; … … 315 530 if ( empty($typenow) ) 316 531 $typenow = 'post'; 317 318 532 $this->id .= '-' . $typenow; 319 533 $this->post_type = $typenow; … … 321 535 if ( empty($typenow) ) 322 536 $typenow = 'post'; 323 324 537 $this->id = $typenow; 325 538 $this->post_type = $typenow; … … 327 540 if ( empty($taxnow) ) 328 541 $taxnow = 'post_tag'; 329 330 542 $this->id = 'edit-' . $taxnow; 331 543 $this->taxonomy = $taxnow; … … 360 572 /** 361 573 * Adds an option for the screen. 362 * Use the 'add_screen_help_and_options' actionto add screen options.574 * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add screen options. 363 575 * 364 576 * @since 3.3.0 365 577 * 366 578 * @param string $option Option ID 367 * @param mixed $args Associative array of arguments particular to the default $option or the HTML string to be printed in the Screen Options tab. 368 */ 369 public function add_option( $option, $args = null ) { 370 if ( is_array($args) && !empty($option) ) 371 $this->_options[ $option ] = $args; 372 elseif ( is_string($option) ) 373 $this->_options['_screen_settings'] .= $option; 374 else 375 return false; 376 377 $this->_show_options = true; 378 return true; 379 } 380 381 /** 382 * Adds option context. 383 * Use the 'add_screen_help_and_options' action to add it. Will not be shown if there aren't any screen options. 384 * 385 * @since 3.3.0 386 * 387 * @param string $text 388 */ 389 public function add_option_context( $text ) { 390 $this->_options['_context'] .= $text; 579 * @param array $args Associative array of arguments particular to the given $option. 580 */ 581 public function add_option( $option, $args = array() ) { 582 $this->_options[ $option ] = $args; 391 583 } 392 584 393 585 /** 394 586 * Add a help tab to the contextual help for the screen. 395 * Use the 'add_screen_help_and_options' actionto add contextual help tabs.587 * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add contextual help tabs. 396 588 * 397 589 * @since 3.3.0 … … 399 591 * @param array $args 400 592 * - string - title - Title for the tab. 401 * - string - id - Tab ID. 402 * - string - section - Section title for the tab. Optional. 593 * - string - id - Tab ID. Optional. 403 594 * - string - content - Help tab content in plain text or HTML. Optional. 404 595 * - callback - callback - A callback to generate the tab content. Optional. … … 409 600 'title' => false, 410 601 'id' => false, 411 'section' => false,412 602 'content' => '', 413 'callback' => false 603 'callback' => false, 414 604 ); 415 605 $args = wp_parse_args( $args, $defaults ); 416 606 417 // Ensure we have title and ID. 418 if ( ! $args['title'] || ! $args['id'] ) 419 return false; 607 // Ensure we have a title. 608 if ( ! $args['title'] ) 609 return; 610 611 // Create an id from the title if one is not provided. 612 if ( ! $args['id'] ) 613 $args['id'] = sanitize_html_class( $args['title'] ); 420 614 421 615 $this->_help_tabs[] = $args; 422 return true;423 616 } 424 617 425 618 /** 426 619 * Add a sidebar to the contextual help for the screen. 427 * Use the 'add_screen_help_and_options' actionto add a sidebar to the contextual help.620 * Call this in template files after admin.php is loaded and before admin-header.php is loaded to add a sidebar to the contextual help. 428 621 * 429 622 * @since 3.3.0 … … 432 625 */ 433 626 public function add_help_sidebar( $content ) { 434 if ( empty($this->_help_sidebar) ) // add only one 435 $this->_help_sidebar = $content; 627 $this->_help_sidebar = $content; 436 628 } 437 629 … … 445 637 public function render_screen_meta() { 446 638 global $_wp_contextual_help; 447 448 // Intended for adding Help and Screen Options.449 do_action('add_screen_help_and_options', $this);450 639 451 640 // Call old contextual_help_list filter. 452 641 if ( ! isset( $_wp_contextual_help ) ) 453 642 $_wp_contextual_help = array(); 454 455 // why are we filtering a global? $_wp_contextual_help = apply_filters( 'contextual_help_list', $_wp_contextual_help, $this ); 643 $_wp_contextual_help = apply_filters( 'contextual_help_list', $_wp_contextual_help, $this ); 456 644 457 645 if ( isset( $_wp_contextual_help[ $this->id ] ) ) { 458 646 // Call old contextual_help filter. 459 // why are we filtering the same global second time??460 647 $contextual_help = apply_filters( 'contextual_help', $_wp_contextual_help[ $this->id ], $this->id, $this ); 461 648 462 649 $this->add_help_tab( array( 463 'title' => __('Screen Info'), 464 'id' => 'screen-info', 465 'content' => $_wp_contextual_help[ $this->id ] 650 'title' => __('Screen Info'), 651 'content' => $contextual_help, 652 ) ); 653 } 654 655 // Add screen options tab 656 if ( $this->show_screen_options() ) { 657 $this->add_help_tab( array( 658 'title' => __('Screen Options'), 659 'callback' => array( $this, 'render_screen_options' ), 466 660 ) ); 467 661 } … … 474 668 <div class="contextual-help-tabs"> 475 669 <ul> 476 <?php 477 478 if ( $this->_show_options ) {479 $class = true;670 <?php foreach ( $this->_help_tabs as $i => $tab ): 671 $link_id = "tab-link-{$tab['id']}"; 672 $panel_id = "tab-panel-{$tab['id']}"; 673 $classes = ( $i == 0 ) ? 'active' : ''; 480 674 ?> 481 <li id="tab-link-screen-options" class="active"> 482 <a href="#tab-panel-screen-options"> 483 <?php _e('Screen Options'); ?> 484 </a> 485 </li> 486 <?php 487 } 488 489 foreach ( $this->_help_tabs as $i => $tab ) { 490 $id = esc_attr($tab['id']); 491 $class = empty($class) && $i == 0 ? ' class="active"' : ''; 492 ?> 493 <li id="<?php echo "tab-link-$id"; ?>"<?php echo $class; ?>> 494 <a href="<?php echo "#tab-panel-$id"; ?>"> 675 676 <li id="<?php echo esc_attr( $link_id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> 677 <a href="<?php echo esc_url( "#$panel_id" ); ?>"> 495 678 <?php echo esc_html( $tab['title'] ); ?> 496 679 </a> 497 680 </li> 498 <?php }?>681 <?php endforeach; ?> 499 682 </ul> 500 683 </div> 501 <?php 502 503 if ( $this->_help_sidebar ) 504 echo '<div class="contextual-help-sidebar">' . $this->_help_sidebar . '</div>'; 505 506 ?> 684 685 <div class="contextual-help-sidebar"> 686 <?php echo $this->_help_sidebar; ?> 687 </div> 688 507 689 <div class="contextual-help-tabs-wrap"> 508 <?php 509 510 if ( $this->_show_options ) { 511 $class2 = true; 512 echo '<div id="tab-panel-screen-options" class="help-tab-content active">'; 513 514 if ( !empty($this->_options['_context']) ) 515 echo $this->_options['_context']; 516 517 $this->render_screen_options(); 518 echo '</div>'; 519 } 520 521 foreach ( $this->_help_tabs as $i => $tab ) { 522 $class2 = empty($class2) && $i == 0 ? ' active' : ''; 690 <?php foreach ( $this->_help_tabs as $i => $tab ): 691 $panel_id = "tab-panel-{$tab['id']}"; 692 $classes = ( $i == 0 ) ? 'active' : ''; 693 $classes .= ' help-tab-content'; 523 694 ?> 524 695 525 <div id="<?php echo esc_attr( "tab-panel-{$tab['id']}" ); ?>" class="help-tab-content<?php echo $class2; ?>"> 696 <div id="<?php echo esc_attr( $panel_id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> 697 <h3><?php echo esc_html( $tab['title'] ); ?></h3> 526 698 <?php 527 if ( $tab['section'] )528 echo '<h3>' . esc_html( $tab['section'] ) . '</h3>';529 530 699 // Print tab content. 531 700 echo $tab['content']; … … 536 705 ?> 537 706 </div> 538 <?php }?>707 <?php endforeach; ?> 539 708 </div> 540 709 </div> … … 543 712 } 544 713 545 /** 546 * Render the screen options tab. 547 * 548 * @since 3.3.0 549 */ 550 public function render_screen_options() { 551 552 $screen_settings = $this->_options['_screen_settings']; 553 554 // Default screen_settings for various screens. 555 // TODO: should probably be set on these screens, not here. 714 public function show_screen_options() { 715 global $wp_meta_boxes, $wp_list_table; 716 717 if ( is_bool( $this->_show_screen_options ) ) 718 return $this->_show_screen_options; 719 720 $columns = get_column_headers( $this ); 721 722 $show_screen = false; 723 if ( ! empty( $wp_meta_boxes[ $this->id ] ) || ! empty( $columns ) ) 724 $show_screen = true; 725 726 // Check if there are per-page options. 727 $show_screen = $show_screen || isset( $this->_options['per_page'] ); 728 729 $this->_screen_settings = apply_filters( 'screen_settings', '', $this ); 730 556 731 switch ( $this->id ) { 557 732 case 'widgets': 558 $screen_settings .= '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n"; 733 $this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n"; 734 $show_screen = true; 559 735 break; 560 736 } 561 737 562 // TODO: deprecate 563 $screen_settings = apply_filters( 'screen_settings', $screen_settings, $this ); 564 565 echo '<form id="adv-settings" action="" method="post">'; 566 567 $this->render_table_columns_prefs(); 568 $this->render_metabox_prefs(); 569 $this->render_screen_layout(); 570 $this->render_per_page_options(); 571 echo $screen_settings; 572 573 wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); 574 echo '</form>'; 575 576 } 577 578 /** 579 * Render the option for hiding table columns on the page 580 * 581 * @since 3.3.0 582 */ 583 function render_table_columns_prefs() { 738 if ( ! empty( $this->_screen_settings ) ) 739 $show_screen = true; 740 741 if ( ! empty( $this->_options ) ) 742 $show_screen = true; 743 744 $this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this ); 745 return $this->_show_screen_options; 746 } 747 748 /** 749 * Render the screen options tab. 750 * 751 * @since 3.3.0 752 */ 753 public function render_screen_options() { 754 global $wp_meta_boxes, $wp_list_table; 755 584 756 $columns = get_column_headers( $this ); 585 586 if ( ! empty( $columns ) ) { 587 $hidden = get_hidden_columns( $this ); 588 ?> 757 $hidden = get_hidden_columns( $this ); 758 759 ?> 760 <form id="adv-settings" action="" method="post"> 761 <?php if ( isset( $wp_meta_boxes[ $this->id ] ) ) : ?> 762 <h5><?php _ex('Show on screen', 'Metaboxes') ?></h5> 763 <div class="metabox-prefs"> 764 <?php meta_box_prefs( $this ); ?> 765 <br class="clear" /> 766 </div> 767 <?php endif; 768 if ( ! empty( $columns ) ) : ?> 589 769 <h5><?php echo ( isset( $columns['_title'] ) ? $columns['_title'] : _x('Show on screen', 'Columns') ) ?></h5> 590 770 <div class="metabox-prefs"> … … 601 781 if ( 'comments' == $column ) 602 782 $title = __( 'Comments' ); 603 604 783 $id = "$column-hide"; 605 784 echo '<label for="' . $id . '">'; … … 610 789 <br class="clear" /> 611 790 </div> 612 <?php } 613 } 614 615 /** 616 * Render the option for hiding metaboxes on the page 617 * 618 * @since 3.3.0 619 */ 620 function render_metabox_prefs() { 621 global $wp_meta_boxes; 622 623 if ( !empty( $wp_meta_boxes[ $this->id ] ) ) { 624 $hidden = get_hidden_meta_boxes($this); 625 ?> 626 <h5><?php _ex('Show on screen', 'Metaboxes') ?></h5> 627 <div class="metabox-prefs"> 628 <?php 629 630 foreach ( array_keys($wp_meta_boxes[$this->id]) as $context ) { 631 foreach ( array_keys($wp_meta_boxes[$this->id][$context]) as $priority ) { 632 foreach ( $wp_meta_boxes[$this->id][$context][$priority] as $box ) { 633 if ( false == $box || ! $box['title'] ) 634 continue; 635 // Submit box cannot be hidden 636 if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] ) 637 continue; 638 $box_id = $box['id']; 639 echo '<label for="' . $box_id . '-hide">'; 640 echo '<input class="hide-postbox-tog" name="' . $box_id . '-hide" type="checkbox" id="' . $box_id . '-hide" value="' . $box_id . '"' . (! in_array($box_id, $hidden) ? ' checked="checked"' : '') . ' />'; 641 echo "{$box['title']}</label>\n"; 642 } 643 } 644 } 645 646 ?> 647 <br class="clear" /> 648 </div> 649 <?php 650 } 791 <?php endif; 792 793 $this->render_screen_layout(); 794 $this->render_per_page_options(); 795 echo $this->_screen_settings; 796 797 ?> 798 <div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div> 799 </form> 800 <?php 651 801 } 652 802 … … 660 810 661 811 // Back compat for plugins using the filter instead of add_screen_option() 662 // TODO: deprecate it663 812 $columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this ); 664 813 665 814 if ( ! empty( $columns ) && isset( $columns[ $this->id ] ) ) 666 $this->add_option( 'layout_columns', array('max' => $columns[ $this->id ] ) );815 add_screen_option( 'layout_columns', array('max' => $columns[ $this->id ] ) ); 667 816 668 817 if ( ! isset( $this->_options['layout_columns'] ) ) { … … 702 851 */ 703 852 function render_per_page_options() { 704 if ( empty( $this->_options['per_page'] ) )853 if ( ! isset( $this->_options['per_page'] ) ) 705 854 return; 706 855 … … 751 900 <?php 752 901 } 753 754 function get_screen_icon( $for = '' ) { 755 756 if ( !empty($for) && is_string($for) ) { 757 $name = $for; 758 } else { 759 if ( !empty($this->parent_base) ) 760 $name = $this->parent_base; 761 else 762 $name = $this->base; 763 } 764 765 if ( 'edit' == $name && isset($this->post_type) && 'page' == $this->post_type ) 766 $name = 'edit-pages'; 767 768 $class = ''; 769 if ( !empty( $this->post_type ) ) 770 $class = ' ' . sanitize_html_class( 'icon32-posts-' . $this->post_type ); 771 772 return '<div id="icon-' . esc_attr( $name ) . '" class="icon32' . $class . '"><br /></div>'; 773 } 774 } 775 902 } -
trunk/wp-admin/index.php
r18889 r18911 24 24 25 25 if ( is_user_admin() ) 26 $current_screen->add_option('layout_columns', array('max' => 4, 'default' => 1) );26 add_screen_option('layout_columns', array('max' => 4, 'default' => 1) ); 27 27 else 28 $current_screen->add_option('layout_columns', array('max' => 4, 'default' => 2) );28 add_screen_option('layout_columns', array('max' => 4, 'default' => 2) ); 29 29 30 $current_screen->add_option_context(31 '<p>test</p>'32 );33 30 34 31 // Help tabs 35 32 36 $help = '<p>' . __('Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the top bar.') . '</p>';33 $help_overview = '<p>' . __('Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the top bar.') . '</p>'; 37 34 38 35 $current_screen->add_help_tab( array( 39 36 'title' => __('Overview'), 40 'id' => 'overview', 41 'content' => $help 37 'content' => $help_overview, 42 38 ) ); 43 39 44 $help = '<p>' . __('The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.') . '</p>45 <p>' . __('Links in the “admin bar” at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.') . '</p>';40 $help_navigation = '<p>' . __('The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.') . '</p>'; 41 $help_navigation .= '<p>' . __('Links in the “admin bar” at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.') . '</p>'; 46 42 47 43 $current_screen->add_help_tab( array( 48 44 'title' => __('Navigation'), 49 'id' => 'navigation', 50 'content' => $help 45 'content' => $help_navigation, 51 46 ) ); 52 47 53 $help = '<p>' . __('You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.') . '</p>54 <p>' . __('<strong>Screen Options</strong> - Use the Screen Options tab to choose which Dashboard boxes to show, and how many columns to display.') . '</p> 55 <p>' . __('<strong>Drag and Drop</strong> - To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.') . '</p> 56 <p>' . __('<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some box have configurable content, and will show a “Configure” link in the title bar if you hover over it.') . '</p>';48 $help_layout = '<p>' . __('You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.') . '</p>'; 49 $help_layout .= '<p>' . __('<strong>Screen Options</strong> - Use the Screen Options tab to choose which Dashboard boxes to show, and how many columns to display.') . '</p>'; 50 $help_layout .= '<p>' . __('<strong>Drag and Drop</strong> - To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.') . '</p>'; 51 $help_layout .= '<p>' . __('<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some box have configurable content, and will show a “Configure” link in the title bar if you hover over it.') . '</p>'; 57 52 58 53 $current_screen->add_help_tab( array( 59 54 'title' => __('Layout'), 60 'id' => 'layout', 61 'content' => $help 55 'content' => $help_layout, 62 56 ) ); 63 57 64 $help = '<p>' . __('The boxes on your Dashboard screen are:') . '</p>65 <p>' . __('<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '</p> 66 <p>' . __('<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.') . '</p> 67 <p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.') . '</p> 68 <p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.') . '</p> 69 <p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you’ve started.') . '</p> 70 <p>' . __('<strong>WordPress Blog</strong> - Latest news from the official WordPress project.') . '</p> 71 <p>' . __('<strong>Other WordPress News</strong> - Shows the <a href="http://planet.wordpress.org" target="_blank">WordPress Planet</a> feed. You can configure it to show a different feed of your choosing.') . '</p> 72 <p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>';58 $help_content = '<p>' . __('The boxes on your Dashboard screen are:') . '</p>'; 59 $help_content .= '<p>' . __('<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '</p>'; 60 $help_content .= '<p>' . __('<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.') . '</p>'; 61 $help_content .= '<p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.') . '</p>'; 62 $help_content .= '<p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.') . '</p>'; 63 $help_content .= '<p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you’ve started.') . '</p>'; 64 $help_content .= '<p>' . __('<strong>WordPress Blog</strong> - Latest news from the official WordPress project.') . '</p>'; 65 $help_content .= '<p>' . __('<strong>Other WordPress News</strong> - Shows the <a href="http://planet.wordpress.org" target="_blank">WordPress Planet</a> feed. You can configure it to show a different feed of your choosing.') . '</p>'; 66 $help_content .= '<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>'; 73 67 74 68 $current_screen->add_help_tab( array( 75 69 'title' => __('Content'), 76 'id' => 'content', 77 'content' => $help 70 'content' => $help_content, 78 71 ) ); 79 72 80 $current_screen->add_help_sidebar( '81 <p><strong>' . __( 'For more information:' ) . '</strong></p> 82 <p>' . __( '<a href="http://codex.wordpress.org/Dashboard_Screen" target="_blank">Documentation on Dashboard</a>' ) . '</p> 83 <p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p> 84 ');73 $current_screen->add_help_sidebar( 74 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 75 '<p>' . __( '<a href="http://codex.wordpress.org/Dashboard_Screen" target="_blank">Documentation on Dashboard</a>' ) . '</p>' . 76 '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' 77 ); 85 78 86 79 -
trunk/wp-admin/link-manager.php
r18867 r18911 40 40 $title = __('Links'); 41 41 $this_file = $parent_file = 'link-manager.php'; 42 43 $current_screen->add_option_context(44 '<p>test</p>'45 );46 42 47 43 add_contextual_help( $current_screen, -
trunk/wp-admin/nav-menus.php
r18882 r18911 446 446 $messages[] = '<div id="message" class="updated"><p>' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '</p></div>'; 447 447 448 $current_screen->add_option_context( 449 '<p>test</p>' 450 ); 451 452 add_contextual_help( $current_screen, ' 453 <p>' . __('This feature allows you to use a custom menu in place of your theme’s default menus. If your theme does not support the custom menus feature yet (the new and old default themes, Twenty Eleven and Twenty Ten, do), you can learn about adding this support by following the Documentation link in this tab. You can still use the “Custom Menu” widget to add menus to a sidebar.') . '</p> 454 <p>' . __('You can create custom menus for your site. These menus may contain links to pages, categories, custom links or other content types (use the Screen Options tab to decide which ones to show on the screen). You can specify a different navigation label for a menu item as well as other attributes. You can create multiple menus. If your theme includes more than one menu, you can choose which custom menu to associate with each. You can also use custom menus in conjunction with the Custom Menus widget.') . '</p> 455 <p>' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You’ll be able to edit the information for each menu item, and can drag and drop to put them in order. You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy. Drop the item into its new nested placement when the dotted rectangle target shifts over, also a little to the right. Don’t forget to click Save when you’re finished.') . '</p> 456 <p><strong>' . __('For more information:') . '</strong></p> 457 <p>' . __('<a href="http://codex.wordpress.org/Appearance_Menus_Screen" target="_blank">Documentation on Menus</a>') . '</p> 458 <p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' ); 448 $help = '<p>' . __('This feature allows you to use a custom menu in place of your theme’s default menus. If your theme does not support the custom menus feature yet (the new and old default themes, Twenty Eleven and Twenty Ten, do), you can learn about adding this support by following the Documentation link in this tab. You can still use the “Custom Menu” widget to add menus to a sidebar.') . '</p>'; 449 $help .= '<p>' . __('You can create custom menus for your site. These menus may contain links to pages, categories, custom links or other content types (use the Screen Options tab to decide which ones to show on the screen). You can specify a different navigation label for a menu item as well as other attributes. You can create multiple menus. If your theme includes more than one menu, you can choose which custom menu to associate with each. You can also use custom menus in conjunction with the Custom Menus widget.') . '</p>'; 450 $help .= '<p>' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You’ll be able to edit the information for each menu item, and can drag and drop to put them in order. You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy. Drop the item into its new nested placement when the dotted rectangle target shifts over, also a little to the right. Don’t forget to click Save when you’re finished.') . '</p>'; 451 $help .= '<p><strong>' . __('For more information:') . '</strong></p>'; 452 $help .= '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Menus_Screen" target="_blank">Documentation on Menus</a>') . '</p>'; 453 $help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'; 454 455 add_contextual_help($current_screen, $help); 459 456 460 457 // Get the admin header -
trunk/wp-admin/network/index.php
r18889 r18911 39 39 add_thickbox(); 40 40 41 $current_screen->add_option('layout_columns', array('max' => 4, 'default' => 2) ); 42 43 $current_screen->add_option_context( 44 '<p>test</p>' 45 ); 41 add_screen_option('layout_columns', array('max' => 4, 'default' => 2) ); 46 42 47 43 require_once( '../admin-header.php' ); -
trunk/wp-admin/network/site-themes.php
r18867 r18911 123 123 124 124 add_thickbox(); 125 $current_screen->add_option( 'per_page', array( 'label' => _x( 'Themes', 'themes per page (screen options)' ) ) ); 126 127 $current_screen->add_option_context( 128 '<p>test</p>' 129 ); 125 add_screen_option( 'per_page', array( 'label' => _x( 'Themes', 'themes per page (screen options)' ) ) ); 130 126 131 127 $site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) ); -
trunk/wp-admin/network/site-users.php
r18867 r18911 154 154 } 155 155 156 $current_screen->add_option( 'per_page', array( 'label' => _x( 'Users', 'users per page (screen options)' ) ) ); 157 158 $current_screen->add_option_context( 159 '<p>test</p>' 160 ); 156 add_screen_option( 'per_page', array( 'label' => _x( 'Users', 'users per page (screen options)' ) ) ); 161 157 162 158 $site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) ); -
trunk/wp-admin/network/sites.php
r18867 r18911 23 23 $parent_file = 'sites.php'; 24 24 25 $current_screen->add_option( 'per_page', array('label' => _x( 'Sites', 'sites per page (screen options)' )) ); 26 27 $current_screen->add_option_context( 28 '<p>test</p>' 29 ); 25 add_screen_option( 'per_page', array('label' => _x( 'Sites', 'sites per page (screen options)' )) ); 30 26 31 27 add_contextual_help($current_screen, -
trunk/wp-admin/network/themes.php
r18869 r18911 202 202 add_thickbox(); 203 203 204 $current_screen->add_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' )) ); 205 206 $current_screen->add_option_context( 207 '<p>test</p>' 208 ); 204 add_screen_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' )) ); 209 205 210 206 add_contextual_help($current_screen, -
trunk/wp-admin/network/users.php
r18867 r18911 228 228 $parent_file = 'users.php'; 229 229 230 $current_screen->add_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) ); 231 232 $current_screen->add_option_context( 233 '<p>test</p>' 234 ); 230 add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) ); 235 231 236 232 add_contextual_help($current_screen, -
trunk/wp-admin/plugin-install.php
r18867 r18911 36 36 do_action('install_plugins_pre_' . $tab); //Used to override the general interface, Eg, install or plugin information. 37 37 38 $current_screen->add_option_context( 39 '<p>test</p>' 38 add_contextual_help($current_screen, 39 '<p>' . sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from WordPress core by thousands of developers all over the world. All plugins in the official <a href="%s" target="_blank">WordPress.org Plugin Directory</a> are compatible with the license WordPress uses. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'http://wordpress.org/extend/plugins/') . '</p>' . 40 '<p>' . __('If you know what you’re looking for, Search is your best bet. The Search screen has options to search the WordPress.org Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting a popular tags. Tags in larger type mean more plugins have been labeled with that tag.') . '</p>' . 41 '<p>' . __('If you just want to get an idea of what’s available, you can browse Featured, Popular, Newest, and Recently Updated plugins by using the links in the upper left of the screen. These sections rotate regularly.') . '</p>' . 42 '<p>' . __('If you want to install a plugin that you’ve downloaded elsewhere, click Upload in the upper left. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.') . '</p>' . 43 '<p><strong>' . __('For more information:') . '</strong></p>' . 44 '<p>' . __('<a href="http://codex.wordpress.org/Plugins_Add_New_Screen" target="_blank">Documentation on Installing Plugins</a>') . '</p>' . 45 '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 40 46 ); 41 42 add_contextual_help( $current_screen, '43 <p>' . sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from WordPress core by thousands of developers all over the world. All plugins in the official <a href="%s" target="_blank">WordPress.org Plugin Directory</a> are compatible with the license WordPress uses. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'http://wordpress.org/extend/plugins/') . '</p>44 <p>' . __('If you know what you’re looking for, Search is your best bet. The Search screen has options to search the WordPress.org Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting a popular tags. Tags in larger type mean more plugins have been labeled with that tag.') . '</p>45 <p>' . __('If you just want to get an idea of what’s available, you can browse Featured, Popular, Newest, and Recently Updated plugins by using the links in the upper left of the screen. These sections rotate regularly.') . '</p>46 <p>' . __('If you want to install a plugin that you’ve downloaded elsewhere, click Upload in the upper left. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.') . '</p>47 <p><strong>' . __('For more information:') . '</strong></p>48 <p>' . __('<a href="http://codex.wordpress.org/Plugins_Add_New_Screen" target="_blank">Documentation on Installing Plugins</a>') . '</p>49 <p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' );50 47 51 48 include(ABSPATH . 'wp-admin/admin-header.php'); -
trunk/wp-admin/plugins.php
r18908 r18911 317 317 add_thickbox(); 318 318 319 $current_screen->add_option( 'per_page', array('label' => _x( 'Plugins', 'plugins per page (screen options)' ), 'default' => 999 ) ); 320 321 $current_screen->add_option_context( 322 '<p>test</p>' 319 add_screen_option( 'per_page', array('label' => _x( 'Plugins', 'plugins per page (screen options)' ), 'default' => 999 ) ); 320 321 add_contextual_help($current_screen, 322 '<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' . 323 '<p>' . sprintf(__('You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your <code>/wp-content/plugins</code> directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'http://wordpress.org/extend/plugins/') . '</p>' . 324 '<p>' . __('Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin’s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.') . '</p>' . 325 '<p>' . sprintf( __('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), WP_PLUGIN_DIR) . '</p>' . 326 '<p><strong>' . __('For more information:') . '</strong></p>' . 327 '<p>' . __('<a href="http://codex.wordpress.org/Managing_Plugins#Plugin_Management" target="_blank">Documentation on Managing Plugins</a>') . '</p>' . 328 '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 323 329 ); 324 325 add_contextual_help( $current_screen, '326 <p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>327 <p>' . sprintf(__('You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your <code>/wp-content/plugins</code> directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'http://wordpress.org/extend/plugins/') . '</p>328 <p>' . __('Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin’s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.') . '</p>329 <p>' . sprintf( __('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), WP_PLUGIN_DIR) . '</p>330 <p><strong>' . __('For more information:') . '</strong></p>331 <p>' . __('<a href="http://codex.wordpress.org/Managing_Plugins#Plugin_Management" target="_blank">Documentation on Managing Plugins</a>') . '</p>332 <p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' );333 330 334 331 $title = __('Plugins'); -
trunk/wp-admin/upload.php
r18876 r18911 144 144 wp_enqueue_script( 'media' ); 145 145 146 $current_screen->add_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) ); 147 148 $current_screen->add_option_context( 149 '<p>test</p>' 146 add_screen_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) ); 147 148 add_contextual_help( $current_screen, 149 '<p>' . __( 'All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the <em>Screen Options</em> tab to customize the display of this screen.' ) . '</p>' . 150 '<p>' . __( 'You can narrow the list by file type/status using the text link filters at the top of the screen. You also can refine the list by date using the dropdown menu above the media table.' ) . '</p>' . 151 '<p>' . __( 'Hovering over a row reveals action links: <em>Edit</em>, <em>Delete Permanently</em>, and <em>View</em>. Clicking <em>Edit</em> or on the media file’s name displays a simple screen to edit that individual file’s metadata. Clicking <em>Delete Permanently</em> will delete the file from the media library (as well as from any posts to which it is currently attached). <em>View</em> will take you to the display page for that file.' ) . '</p>' . 152 '<p>' . __( 'If a media file has not been attached to any post, you will see that in the <em>Attached To</em> column, and can click on <em>Attach File</em> to launch a small popup that will allow you to search for a post and attach the file.' ) . '</p>' . 153 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 154 '<p>' . __( '<a href="http://codex.wordpress.org/Media_Library_Screen" target="_blank">Documentation on Media Library</a>' ) . '</p>' . 155 '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' 150 156 ); 151 152 add_contextual_help( $current_screen, '153 <p>' . __( 'All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the <em>Screen Options</em> tab to customize the display of this screen.' ) . '</p>154 <p>' . __( 'You can narrow the list by file type/status using the text link filters at the top of the screen. You also can refine the list by date using the dropdown menu above the media table.' ) . '</p>155 <p>' . __( 'Hovering over a row reveals action links: <em>Edit</em>, <em>Delete Permanently</em>, and <em>View</em>. Clicking <em>Edit</em> or on the media file’s name displays a simple screen to edit that individual file’s metadata. Clicking <em>Delete Permanently</em> will delete the file from the media library (as well as from any posts to which it is currently attached). <em>View</em> will take you to the display page for that file.' ) . '</p>156 <p>' . __( 'If a media file has not been attached to any post, you will see that in the <em>Attached To</em> column, and can click on <em>Attach File</em> to launch a small popup that will allow you to search for a post and attach the file.' ) . '</p>157 <p><strong>' . __( 'For more information:' ) . '</strong></p>158 <p>' . __( '<a href="http://codex.wordpress.org/Media_Library_Screen" target="_blank">Documentation on Media Library</a>' ) . '</p>159 <p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' );160 157 161 158 require_once('./admin-header.php'); -
trunk/wp-admin/users.php
r18867 r18911 18 18 $parent_file = 'users.php'; 19 19 20 $current_screen->add_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) ); 21 22 $current_screen->add_option_context( 23 '<p>test</p>' 20 add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) ); 21 22 // contextual help - choose Help on the top right of admin panel to preview this. 23 add_contextual_help($current_screen, 24 '<p>' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.') . '</p>' . 25 '<p>' . __('You can customize the display of information on this screen as you can on other screens, by using the Screen Options tab and the on-screen filters.') . '</p>' . 26 '<p>' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '</p>' . 27 '<p><strong>' . __('For more information:') . '</strong></p>' . 28 '<p>' . __('<a href="http://codex.wordpress.org/Users_Screen" target="_blank">Documentation on Managing Users</a>') . '</p>' . 29 '<p>' . __('<a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Descriptions of Roles and Capabilities</a>') . '</p>' . 30 '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 24 31 ); 25 26 add_contextual_help( $current_screen, '27 <p>' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.') . '</p>28 <p>' . __('You can customize the display of information on this screen as you can on other screens, by using the Screen Options tab and the on-screen filters.') . '</p>29 <p>' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '</p>30 <p><strong>' . __('For more information:') . '</strong></p>31 <p>' . __('<a href="http://codex.wordpress.org/Users_Screen" target="_blank">Documentation on Managing Users</a>') . '</p>32 <p>' . __('<a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Descriptions of Roles and Capabilities</a>') . '</p>33 <p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' );34 32 35 33 if ( empty($_REQUEST) ) { -
trunk/wp-admin/widgets.php
r18882 r18911 36 36 $parent_file = 'themes.php'; 37 37 38 $current_screen->add_option_context( 39 '<p>test</p>' 40 ); 41 42 add_contextual_help( $current_screen, ' 43 <p>' . __('Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.') . '</p> 44 <p>' . __('The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.') . '</p> 45 <p>' . __('If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.') . '</p> 46 <p>' . __('Widgets may be used multiple times. You can give each widget a title, to display on your site, but it’s not required.') . '</p> 47 <p>' . __('Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.') . '</p> 48 <p>' . __('Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.') . '</p> 49 <p><strong>' . __('For more information:') . '</strong></p> 50 <p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_Screen" target="_blank">Documentation on Widgets</a>') . '</p> 51 <p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' ); 38 $help = ' 39 <p>' . __('Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.') . '</p> 40 <p>' . __('The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.') . '</p> 41 <p>' . __('If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.') . '</p> 42 <p>' . __('Widgets may be used multiple times. You can give each widget a title, to display on your site, but it’s not required.') . '</p> 43 <p>' . __('Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.') . '</p> 44 <p>' . __('Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.') . '</p> 45 '; 46 $help .= '<p><strong>' . __('For more information:') . '</strong></p>'; 47 $help .= '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_Screen" target="_blank">Documentation on Widgets</a>') . '</p>'; 48 $help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'; 49 add_contextual_help($current_screen, $help); 52 50 53 51 // These are the widgets grouped by sidebar
Note: See TracChangeset
for help on using the changeset viewer.