This file contains hidden or 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 WP API endpoint for form submission, then create new | |
* Gravity Forms entry and send notifications. | |
*/ | |
// rest api endpoint for forms submission | |
add_action( 'rest_api_init', function () { | |
register_rest_route( 'ahr/v1', '/forms', array( | |
'methods' => 'POST', |
This file contains hidden or 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', 'query_offset', 1 ); | |
function query_offset( &$query ) { | |
// Before anything else, make sure this is the right query... | |
if ( ! ( $query->is_home() || is_main_query() ) || is_admin() ) { | |
return; | |
} | |
// First, define your desired offset... | |
$offset = -1; |
NewerOlder