Created
October 7, 2019 15:23
-
-
Save Pross/e4f82af63755e455b28ed4c021c933ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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