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
import withUniqueId from './with-unique-id'; | |
function FormField({ | |
id, | |
label, | |
value, | |
onChange, | |
}) { | |
return ( | |
<div> |
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 | |
/** | |
* Defer loading of scripts until consent given (using Altis consent API). | |
* | |
* Note this requires the script to be enqueued in the normal manner. | |
* Scripts are loaded async so must be compatible with this, can't have dependencies etc. | |
* | |
* @package | |
*/ |
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 | |
/** | |
* Plugin Name: Speculative Loading Eager Prerender Demo Plugin | |
* Description: Overrides WordPress speculative loading rules to use "eager" and "prerender" for better perceived performance. | |
* Version: 1.0 | |
* Author: Matthew Haines-Young | |
*/ | |
// Hook into the filter WordPress uses to generate the speculationrules script. | |
add_filter('wp_speculation_rules', function($rules) { |
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 | |
/** | |
* Plugin Name: Speculative Loading Eager Prerender | |
* Description: Overrides WordPress speculative loading rules to use "eager" and "prerender" for better perceived performance. | |
* Version: 1.0 | |
* Author: Your Name | |
*/ | |
add_filter( | |
'wp_speculation_rules_configuration', |
OlderNewer