Skip to main content

Change the Default Post Status

Written by Patrick Garman
Updated over 3 weeks ago

By default, requests are published as pending. If you want to automatically publish them, you can do so with the following code.

/**
* Change default request status to "publish".
*
* @return string
*/
function jck_sfr_change_default_post_status() {
return 'publish';
}

add_filter( 'jck_sfr_get_default_post_status', 'jck_sfr_change_default_post_status', 10 );

Add the code to the end of your theme or child theme's functions.php file.

Did this answer your question?