下記のコードを使用してWordPressでカスタム投稿ステータスを作成しました(functions.php内)。その理由は、私たちのウェブサイトには2人の編集者がいて、編集者が編集中の記事を表示する方法が必要です(デフォルトのWordPress "Pending"オプションは、記事が審査待ちの場合のみ使用されます)ブログ編集者は、編集長の副社長)。WordPressの管理パネルで[すべて]リンクをクリックすると、カスタム投稿ステータスの記事を表示するにはどうすればよいですか?
私の問題は、WordPress管理パネルの[投稿]ページの上部にある[すべて]リンクを選択すると、新しいステータスに設定されている記事が表示されないということです。他のすべての投稿は、新しいステータスのものを除いて表示されます。ページの上部に新しいステータスの記事だけを表示する新しいリンクがあり、それは正しく機能しますが、すべてのリンクをクリックしてこれらの記事を表示するにはどうしたらいいですか?
// Register Custom Status
function custom_post_status() {
$args = array(
'label' => _x('PendingLuke', 'Status General Name', 'text_domain'),
'label_count' => _n_noop('PendingLuke (%s)', 'Pending Luke (%s)', 'text_domain'),
'public' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'exclude_from_search' => true,
);
register_post_status('pendingluke', $args);
}
add_action('init', 'custom_post_status', 0);
function add_to_post_status_dropdown()
{
?>
<script>
jQuery(document).ready(function($){
$("select#post_status").append("<option value=\"PendingLuke\" <?php selected('PendingLuke', $post->post_status); ?>>PendingLuke</option>");
});
</script>
<?php
}
add_action('post_submitbox_misc_actions', 'add_to_post_status_dropdown');