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 | |
if ( is_user_logged_in() && current_user_can( 'manage_options' ) ) { | |
define('DONOTCACHEPAGE', true); | |
} | |
?> |
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 | |
if (is_buddypress()){ | |
define('DONOTCACHEPAGE', true); | |
} |
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 show_thumbnail_url ($url, $width=600, $height=300){ | |
return 'http://s.wordpress.com/mshots/v1/'.urlencode($url).'?w='.$width.'&h='.$height.'; | |
} |
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', '__rocket_lazyload_if_log' ); | |
function __rocket_lazyload_if_log() { | |
if (is_user_logged_in ()){ | |
add_filter( 'do_rocket_lazyload', '__return_false' ); | |
} | |
} |
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_filter('wp_get_attachment_image_attributes', function($attr) { | |
if (isset($attr['sizes'])) unset($attr['sizes']); | |
if (isset($attr['srcset'])) unset($attr['srcset']); | |
return $attr; | |
}, PHP_INT_MAX); | |
add_filter('wp_calculate_image_sizes', '__return_false', PHP_INT_MAX); | |
add_filter('wp_calculate_image_srcset', '__return_false', PHP_INT_MAX); | |
remove_filter('the_content', 'wp_make_content_images_responsive'); |
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_action( 'wp_enqueue_scripts', 'test_register_script' ); | |
function test_register_script(){ | |
wp_enqueue_script( 'test', get_template_directory_uri().'/js/test.js', false, '2.10.3'); | |
} |
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 | |
if ( wp_is_mobile() ) { | |
add_filter( 'do_rocket_lazyload', '__return_false' ); | |
} | |
?> |
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 | |
remove_action( 'user_register', 'rocket_clean_domain' ); | |
remove_action( 'profile_update', 'rocket_clean_domain' ); | |
remove_action( 'deleted_user', 'rocket_clean_domain' ); | |
remove_action( 'wp_update_nav_menu', 'rocket_clean_domain' ); | |
remove_action( 'update_option_theme_mods_' . get_option( 'stylesheet' ), 'rocket_clean_domain' ); | |
remove_action( 'update_option_sidebars_widgets', 'rocket_clean_domain' ); | |
remove_action( 'update_option_category_base', 'rocket_clean_domain' ); | |
remove_action( 'update_option_tag_base' , 'rocket_clean_domain' ); | |
remove_action( 'permalink_structure_changed', 'rocket_clean_domain' ); |
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 clear_rocket_woocommerce_thankyou( $order_id ) { | |
// code to retrieve the products id from the $order_id | |
// should return an array of ids of the orders names $products_id | |
//empty in this exemple | |
$products_id = array(); | |
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 clear_rocket_woocommerce_thankyou( $order_id ) { | |
// clear Rocket cache | |
rocket_clean_domain(); | |
}; | |
add_action( 'woocommerce_thankyou', 'clear_rocket_woocommerce_thankyou', 10, 1 ); |