如果您使用的是WP 3.0+,则应该能够使用register\\u post\\u status()方法将新状态注册为public。我还没有在法典中看到它,但下面是记录的内容:
/**
* Register a post type. Do not use before init.
*
* A simple function for creating or modifying a post status based on the
* parameters given. The function will accept an array (second optional
* parameter), along with a string for the post status name.
*
*
* Optional $args contents:
*
* label - A descriptive name for the post status marked for translation. Defaults to $post_status.
* public - Whether posts of this status should be shown in the admin UI. Defaults to true.
* exclude_from_search - Whether to exclude posts with this post status from search results. Defaults to true.
*
* @package WordPress
* @subpackage Post
* @since 3.0.0
* @uses $wp_post_statuses Inserts new post status object into the list
*
* @param string $post_status Name of the post status.
* @param array|string $args See above description.
*/
function register_post_status($post_status, $args = array()) {....
基于此,您应该能够拨打:
function add_pitch_status() {
register_post_status(\'pitch\', array(\'public\'=>true));
}
add_action(\'init\', \'add_pitch_status\');