Last active
April 24, 2025 20:00
-
-
Save robwent/fa8df36eb81f0ecaac37b86e8210a4ab to your computer and use it in GitHub Desktop.
Caching Contact Form 7 Schema Requests
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_filter( 'wp_rest_cache/allowed_endpoints', function ( $allowed_endpoints ) { | |
if ( ! isset( $allowed_endpoints['contact-form-7/v1'] ) ) { | |
$allowed_endpoints['contact-form-7/v1'] = []; | |
} | |
if ( ! in_array( 'contact-forms', $allowed_endpoints['contact-form-7/v1'], true ) ) { | |
$allowed_endpoints['contact-form-7/v1'][] = 'contact-forms'; | |
} | |
return $allowed_endpoints; | |
}, 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment