Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add_action( 'pre_get_posts', function( $query ) {
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
$query->set( 'post_status', array( 'private', 'publish' ) );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.