Site icon Hip-Hop Website Design and Development

wp_query ignoring customized post_status

I’ve a customized publish standing referred to as ‘useless.’ I’m making an attempt to create a wp_query to indicate all posts for a customized taxonomy. If I specify ‘any’ for the post_status I do get revealed posts and my ‘useless’ post_status posts. Likewise, if I set the post_status parameter to solely ‘useless’ I do get simply these posts. However, if I attempt to set the post_status to indicate each revealed and useless post_status posts through an array I can solely get the revealed ones.

$args = array(
    'post_status' => array('publish', 'useless'),
    'post_type' => 'publish',
    'posts_per_page' => -1,
    'orderby' => 'post_title',
    'order' => 'ASC',
    'tax_query' => array(
        array(
            'taxonomy' => 'linktypes',
            'discipline'    => 'id',
            'phrases'    => '15'
        ),
    )
);  
$my_query = new wp_query( $args );

Does WordPress not help you specify each normal and customized post_statuses in an array like this? Or am I simply doing one thing fallacious?

UPDATE: As really helpful, I’m including the code I exploit to create the customized post_status (in addition to the code so as to add it to the admin display screen and fast edit display screen simply in case that is likely to be related.

perform custom_post_status() {
    register_post_status( 'useless', array(
        'label'                     => _x( 'Useless', 'publish' ),
        'public'                    => true,
        'exclude_from_search'       => false,
        'show_in_admin_all_list'    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop( 'Useless <span class="count">(%s)</span>', 'Useless <span class="count">(%s)</span>' ),
    ) );
}
add_action( 'init', 'custom_post_status' );


perform my_post_submitbox_misc_actions() {
    world $publish;
    //solely when enhancing a publish
    if( $post->post_type == 'publish' ){
        // customized publish standing: useless
        $full = '';
        $label = '';   

        if( $post->post_status == 'useless' ){
            $full = ' chosen="selected"';
            $label = '<span id="post-status-display"> Useless</span>';
        }

        echo '<script>
        jQuery(doc).prepared(perform($){
            $("select#post_status").append("<option value="publish" selected="publish">Publish</option>");
            $("select#post_status").append("<option value="useless" '.$complete.'>Dead</option>");
            $(".misc-pub-section label").append("'.$label.'");
        });
        </script>';
    }
}
add_action( 'post_submitbox_misc_actions', 'my_post_submitbox_misc_actions' );


perform rudr_status_into_inline_edit() { 
    echo "<script>
    jQuery(doc).prepared( perform() {
        jQuery( 'choose[name="_status"]' ).append( '<possibility worth="dead">Useless</possibility>' );
    });
    </script>";
}
add_action('admin_footer-edit.php','rudr_status_into_inline_edit');