Created
June 4, 2017 17:53
-
-
Save ishansharma/eb7f0fc05dc79312098952e319515095 to your computer and use it in GitHub Desktop.
Send all results for a post type with WordPress
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
<?php | |
add_action( 'rest_customer_query', 'customer_override_per_page' ); | |
/* | |
* params is the query array passed to WP_Query | |
*/ | |
function customer_override_per_page( $params ) { | |
if ( isset( $params ) AND isset( $params[ 'posts_per_page' ] ) ) { | |
$params[ 'posts_per_page' ] = PHP_INT_MAX; | |
} | |
return $params; | |
} |
I think this would be better
$params[ 'nopaging' ] = true;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ishansharma: Any updates on this?