Strattic Developer Docs

Add or Filter Custom Post Status to Publishes

We have a new Strattic filter that can be used to add a custom post status to the publish process!

By default, we only publish the following post statuses:

type array: ['publish', 'private', 'inherit', 'trash']

If you have a custom post status you’d like to add, for example, job_down , you can do so like this:

add_filter( 'strattic_post_statuses', 'add_job_statuses');

function add_job_statuses( $statuses ) {
    $statuses[] = 'job_down';
    return $statuses;
}

If you would like to change the status in the array to only publish posts with a publish status, you could do something like this:

add_filter( 'strattic_post_statuses', 'filter_post_publish_status');

function filter_post_publish_status( $statuses ) {
    $statuses = array( 'publish' );
    return $statuses;
}

Enjoy! 🤓