回答this Question, 找到了Ana Ban的jQuery解决方案。
add_action( \'admin_head\', \'wpse_56551_script_enqueuer\' );
function wpse_56551_script_enqueuer()
{
global $current_screen;
/**
/wp-admin/edit.php?post_type=post
/wp-admin/edit.php?post_type=page
/wp-admin/edit.php?post_type=cpt == gallery in this example
*/
if( \'edit-gallery\' == $current_screen->id )
{
?>
<script type="text/javascript">
jQuery(document).ready( function($) {
$("a.editinline").live("click", function () {
var ilc_qe_id = inlineEditPost.getId(this);
setTimeout(function() {
$(\'#edit-\'+ilc_qe_id+\' select[name="_status"] option[value="pending"]\').remove();
$(\'#edit-\'+ilc_qe_id+\' select[name="_status"] option[value="private"]\').remove();
}, 100);
});
$(\'#doaction, #doaction2\').live("click", function () {
setTimeout(function() {
$(\'#bulk-edit select[name="_status"] option[value="pending"]\').remove();
$(\'#bulk-edit select[name="_status"] option[value="private"]\').remove();
}, 100);
});
});
</script>
<?php
}
/**
/wp-admin/post.php?post=21&action=edit
*/
if( \'gallery\' == $current_screen->id )
{
?>
<script type="text/javascript">
jQuery(document).ready( function($) {
$(\'#post_status option[value="pending"]\').remove();
$(\'#post_status option[value="private"]\').remove();
});
</script>
<?php
}
}
[Original Answer]
在中搜索此筛选器
/wp-admin/
, 我们发现它位于
/wp-admin/includes/class-wp-posts-list-table.php
. 我们看到它处理的是职位的等级,而不是地位。。。
在这个文件的后面,我们找到了状态组,但它没有任何过滤器,所以我怀疑不会有挂钩的解决方案。。。
// starting at line 950
<div class="inline-edit-group">
<label class="inline-edit-status alignleft">
<span class="title"><?php _e( \'Status\' ); ?></span>
<select name="_status">
<?php if ( $bulk ) : ?>
<option value="-1"><?php _e( \'— No Change —\' ); ?></option>
<?php endif; // $bulk ?>
<?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review" ?>
<option value="publish"><?php _e( \'Published\' ); ?></option>
<option value="future"><?php _e( \'Scheduled\' ); ?></option>
<?php if ( $bulk ) : ?>
<option value="private"><?php _e( \'Private\' ) ?></option>
<?php endif; // $bulk ?>
<?php endif; ?>
<option value="pending"><?php _e( \'Pending Review\' ); ?></option>
<option value="draft"><?php _e( \'Draft\' ); ?></option>
</select>
</label>