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
/** | |
* Applies eager loading to the first three (3) posts in the "recipe_list" FacetWP listing. | |
* | |
* @param array $output | |
* @param array $params | |
* | |
* @return array | |
*/ | |
function sitecare_facetwp_image_loading_strategy( array $output, array $params ): array { |
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
# Run this at the beginning of the sessions in case the host removed packages after disconnecting | |
wp package install wp-media/wp-rocket-cli:trunk | |
# On WPEngine, this will clear all caches, including Cloudflare | |
wp rocket clean --confirm && wp cache flush |
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 a control to the Elementor Image Widget to explicitly adjust the loading strategy. | |
* | |
* @param \Elementor\Widget_Image $element | |
* | |
* @return void | |
*/ | |
function sitecare_elementor_image_widget_loading_control( \Elementor\Widget_Image $element ): void { |
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 | |
/** | |
* Preload Elementor background images if they are among the first elements on a page. | |
* | |
* @return void | |
*/ | |
function sitecare_preload_elementor_background_images(): void { | |
if ( ! did_action( 'elementor/loaded' ) ) { |
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 | |
define( 'WAR_LOG_FILE', sprintf( '%s%sdebug.html', __DIR__, DIRECTORY_SEPARATOR ) ); | |
define( 'WAR_LOG_URL', sprintf( 'https://%s/debug.php', $_SERVER['HTTP_HOST'] ?? '' ) ); | |
/** | |
* @param mixed $arg | |
* | |
* @return mixed | |
*/ |