Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created September 22, 2020 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/ada38c7a10b6839fff20d4bf9b0e67ac to your computer and use it in GitHub Desktop.
Save Pebblo/ada38c7a10b6839fff20d4bf9b0e67ac to your computer and use it in GitHub Desktop.
Remove Yoast's 'fill_cache' callback from Event Espresso's wpuser_login step ajax request.
<?php
// Remove Yoast fill_cache from EE's wpuser_login ajax request.
add_action( 'wp_loaded', 'ee_remove_yoast_fill_cache', 10);
function ee_remove_yoast_fill_cache(){
if( wp_doing_ajax() ) {
if(
class_exists('WPSEO_Options')
|| class_exists('EE_Registry')
|| EE_Registry::instance()->REQ->get('step', '') === 'wpuser_login'
) {
$Admin_Columns_Cache_Integration = YoastSEO()->classes->get( 'Yoast\WP\SEO\Integrations\Admin\Admin_Columns_Cache_Integration' );
remove_action( 'admin_init', [ $Admin_Columns_Cache_Integration, 'fill_cache' ], 10 );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment