UI String */ function get_column_headers( $screen ) { if ( is_string( $screen ) ) $screen = convert_to_screen( $screen ); global $_wp_column_headers; if ( !isset( $_wp_column_headers[ $screen->id ] ) ) { $_wp_column_headers[ $screen->id ] = apply_filters( 'manage_' . $screen->id . '_columns', array() ); } return $_wp_column_headers[ $screen->id ]; } /** * Get a list of hidden columns. * * @since 2.7.0 * * @param string|object $screen The screen you want the hidden columns for * @return array */ function get_hidden_columns( $screen ) { if ( is_string( $screen ) ) $screen = convert_to_screen( $screen ); return (array) get_user_option( 'manage' . $screen->id . 'columnshidden' ); } /** * {@internal Missing Short Description}} * * @since 2.7.0 * * @param unknown_type $screen */ function meta_box_prefs($screen) { global $wp_meta_boxes; if ( is_string($screen) ) $screen = convert_to_screen($screen); if ( empty($wp_meta_boxes[$screen->id]) ) return; $hidden = get_hidden_meta_boxes($screen); foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) { foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) { foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) { if ( false == $box || ! $box['title'] ) continue; // Submit box cannot be hidden if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] ) continue; $box_id = $box['id']; echo '\n"; } } } } /** * Get Hidden Meta Boxes * * @since 2.7.0 * * @param string|object $screen Screen identifier * @return array Hidden Meta Boxes */ function get_hidden_meta_boxes( $screen ) { if ( is_string( $screen ) ) $screen = convert_to_screen( $screen ); $hidden = get_user_option( "metaboxhidden_{$screen->id}" ); // Hide slug boxes by default if ( !is_array( $hidden ) ) { if ( 'post' == $screen->base || 'page' == $screen->base ) $hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv'); else $hidden = array( 'slugdiv' ); $hidden = apply_filters('default_hidden_meta_boxes', $hidden, $screen); } return $hidden; } /** * {@internal Missing Short Description}} * * @since 2.7.0 */ function favorite_actions( $screen = null ) { $default_action = false; if ( is_string($screen) ) $screen = convert_to_screen($screen); if ( $screen->is_user ) return; if ( isset($screen->post_type) ) { $post_type_object = get_post_type_object($screen->post_type); if ( 'add' != $screen->action ) $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)); else $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->name, $post_type_object->cap->edit_posts)); } if ( !$default_action ) { if ( $screen->is_network ) { $default_action = array('sites.php' => array( __('Sites'), 'manage_sites')); } else { switch ( $screen->id ) { case 'upload': $default_action = array('media-new.php' => array(__('New Media'), 'upload_files')); break; case 'media': $default_action = array('upload.php' => array(__('Edit Media'), 'upload_files')); break; case 'link-manager': case 'link': if ( 'add' != $screen->action ) $default_action = array('link-add.php' => array(__('New Link'), 'manage_links')); else $default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links')); break; case 'users': $default_action = array('user-new.php' => array(__('New User'), 'create_users')); break; case 'user': $default_action = array('users.php' => array(__('Edit Users'), 'edit_users')); break; case 'plugins': $default_action = array('plugin-install.php' => array(__('Install Plugins'), 'install_plugins')); break; case 'plugin-install': $default_action = array('plugins.php' => array(__('Manage Plugins'), 'activate_plugins')); break; case 'themes': $default_action = array('theme-install.php' => array(__('Install Themes'), 'install_themes')); break; case 'theme-install': $default_action = array('themes.php' => array(__('Manage Themes'), 'switch_themes')); break; default: $default_action = array('post-new.php' => array(__('New Post'), 'edit_posts')); break; } } } if ( !$screen->is_network ) { $actions = array( 'post-new.php' => array(__('New Post'), 'edit_posts'), 'edit.php?post_status=draft' => array(__('Drafts'), 'edit_posts'), 'post-new.php?post_type=page' => array(__('New Page'), 'edit_pages'), 'media-new.php' => array(__('Upload'), 'upload_files'), 'edit-comments.php' => array(__('Comments'), 'moderate_comments') ); } else { $actions = array( 'sites.php' => array( __('Sites'), 'manage_sites'), 'users.php' => array( __('Users'), 'manage_network_users') ); } $default_key = array_keys($default_action); $default_key = $default_key[0]; if ( isset($actions[$default_key]) ) unset($actions[$default_key]); $actions = array_merge($default_action, $actions); $actions = apply_filters( 'favorite_actions', $actions, $screen ); $allowed_actions = array(); foreach ( $actions as $action => $data ) { if ( current_user_can($data[1]) ) $allowed_actions[$action] = $data[0]; } if ( empty($allowed_actions) ) return; $first = array_keys($allowed_actions); $first = $first[0]; echo '
' . __('Enable accessibility mode') . '' . __('Disable accessibility mode') . "
\n"; $show_screen = true; break; } if ( ! empty( $settings ) ) $show_screen = true; if ( !empty($wp_current_screen_options) ) $show_screen = true; $show_screen = apply_filters('screen_options_show_screen', $show_screen, $screen); // If we have screen options, add the menu to the admin bar. if ( $show_screen ) add_action( 'admin_bar_menu', 'wp_admin_bar_screen_options_menu', 80 ); ?>