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
| function ProviderComposer({ contexts, children }) { | |
| return contexts.reduceRight( | |
| (kids, parent) => | |
| React.cloneElement(parent, { | |
| children: kids, | |
| }), | |
| children | |
| ); | |
| } |
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 featured image url to api response | |
| * This will (hopefully) be unnecessary if the API team adds it to core | |
| * | |
| */ | |
| add_action( 'rest_api_init', 'sb_register_featured_urls' ); | |
| function sb_register_featured_urls() { | |
| register_api_field( '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
| <?php | |
| function wp_log_http_requests( $response, $args, $url ) { | |
| // set your log file location here | |
| $logfile = plugin_dir_path( __FILE__ ) . '/http_requests.log'; | |
| // parse request and response body to a hash for human readable log output | |
| $log_response = $response; | |
| if ( isset( $args['body'] ) ) { |