- echo $screen_options;
- echo $settings; ?>
-<div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
-</form>
-</div>
-
-<?php endif; // $show_screen
-
- $_wp_contextual_help = apply_filters('contextual_help_list', $_wp_contextual_help, $screen);
- ?>
- <div id="contextual-help-wrap" class="hidden">
- <?php
- $contextual_help = '';
- if ( isset($_wp_contextual_help[$screen->id]) ) {
- $contextual_help .= '<div class="metabox-prefs">' . $_wp_contextual_help[$screen->id] . "</div>\n";
- } else {
- $contextual_help .= '<div class="metabox-prefs">';
- $default_help = __('<a href="http://codex.wordpress.org/" target="_blank">Documentation</a>');
- $default_help .= '<br />';
- $default_help .= __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>');
- $contextual_help .= apply_filters('default_contextual_help', $default_help);
- $contextual_help .= "</div>\n";
- }
-
- echo apply_filters('contextual_help', $contextual_help, $screen->id, $screen);
- ?>
- </div>
-
-<div id="screen-meta-links">
-<div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle">
-<a href="#contextual-help" id="contextual-help-link" class="show-settings"><?php _e('Help') ?></a>
-</div>
-<?php if ( $show_screen ) { ?>
-<div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">
-<a href="#screen-options" id="show-settings-link" class="show-settings"><?php _e('Screen Options') ?></a>
-</div>
-<?php } ?>
-</div>
-</div>
-<?php
-}
-
-/**
- * Add contextual help text for a page
- *
- * @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 string $help Arbitrary help text
- */
-function add_contextual_help($screen, $help) {
- global $_wp_contextual_help;
-
- if ( is_string($screen) )
- $screen = convert_to_screen($screen);
-
- if ( !isset($_wp_contextual_help) )
- $_wp_contextual_help = array();
-
- $_wp_contextual_help[$screen->id] = $help;
-}
-
-function screen_layout($screen) {
- global $screen_layout_columns, $wp_current_screen_options;
-
- if ( is_string($screen) )
- $screen = convert_to_screen($screen);
-
- // Back compat for plugins using the filter instead of add_screen_option()
- $columns = apply_filters('screen_layout_columns', array(), $screen->id, $screen);
- if ( !empty($columns) && isset($columns[$screen->id]) )
- add_screen_option('layout_columns', array('max' => $columns[$screen->id]) );
-
- if ( !isset($wp_current_screen_options['layout_columns']) ) {
- $screen_layout_columns = 0;
- return '';
- }
-
- $screen_layout_columns = get_user_option("screen_layout_$screen->id");
- $num = $wp_current_screen_options['layout_columns']['max'];
-
- if ( ! $screen_layout_columns ) {
- if ( isset($wp_current_screen_options['layout_columns']['default']) )
- $screen_layout_columns = $wp_current_screen_options['layout_columns']['default'];
- else
- $screen_layout_columns = 2;
- }
-
- $i = 1;
- $return = '<h5>' . __('Screen Layout') . "</h5>\n<div class='columns-prefs'>" . __('Number of Columns:') . "\n";
- while ( $i <= $num ) {
- $return .= "<label><input type='radio' name='screen_columns' value='$i'" . ( ($screen_layout_columns == $i) ? " checked='checked'" : "" ) . " /> $i</label>\n";
- ++$i;
- }
- $return .= "</div>\n";
- return $return;
-}
-
-/**
- * Register and configure an admin screen option
- *
- * @since 3.1.0
- *
- * @param string $option An option name.
- * @param mixed $args Option dependent arguments
- * @return void
- */
-function add_screen_option( $option, $args = array() ) {
- global $wp_current_screen_options;
-
- if ( !isset($wp_current_screen_options) )
- $wp_current_screen_options = array();
-
- $wp_current_screen_options[$option] = $args;
-}
-
-function screen_options($screen) {
- global $wp_current_screen_options;
-
- if ( is_string($screen) )
- $screen = convert_to_screen($screen);
-
- if ( !isset($wp_current_screen_options['per_page']) )
- return '';
-
- $per_page_label = $wp_current_screen_options['per_page']['label'];
-
- if ( empty($wp_current_screen_options['per_page']['option']) ) {
- $option = str_replace( '-', '_', "{$screen->id}_per_page" );
- } else {
- $option = $wp_current_screen_options['per_page']['option'];
- }
-
- $per_page = (int) get_user_option( $option );
- if ( empty( $per_page ) || $per_page < 1 ) {
- if ( isset($wp_current_screen_options['per_page']['default']) )
- $per_page = $wp_current_screen_options['per_page']['default'];
- else
- $per_page = 20;
- }
-
- if ( 'edit_comments_per_page' == $option )
- $per_page = apply_filters( 'comments_per_page', $per_page, isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all' );
- elseif ( 'categories_per_page' == $option )
- $per_page = apply_filters( 'edit_categories_per_page', $per_page );
- else
- $per_page = apply_filters( $option, $per_page );
-
- // Back compat
- if ( isset( $screen->post_type ) )
- $per_page = apply_filters( 'edit_posts_per_page', $per_page, $screen->post_type );
-
- $return = "<div class='screen-options'>\n";
- if ( !empty($per_page_label) )
- $return .= "<input type='text' class='screen-per-page' name='wp_screen_options[value]' id='$option' maxlength='3' value='$per_page' /> <label for='$option'>$per_page_label</label>\n";
- $return .= get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false );
- $return .= "<input type='hidden' name='wp_screen_options[option]' value='" . esc_attr($option) . "' />";
- $return .= "</div>\n";
- return $return;
-}
-
-function screen_icon($screen = '') {
- global $current_screen, $typenow;
-
- if ( empty($screen) )
- $screen = $current_screen;
- elseif ( is_string($screen) )
- $name = $screen;
-
- $class = 'icon32';
-
- if ( empty($name) ) {
- if ( !empty($screen->parent_base) )
- $name = $screen->parent_base;
- else
- $name = $screen->base;
-
- if ( 'edit' == $name && isset($screen->post_type) && 'page' == $screen->post_type )
- $name = 'edit-pages';
-
- $post_type = '';
- if ( isset( $screen->post_type ) )
- $post_type = $screen->post_type;
- elseif ( $current_screen == $screen )
- $post_type = $typenow;
- if ( $post_type )
- $class .= ' ' . sanitize_html_class( 'icon32-posts-' . $post_type );