if(!function_exists('bridge_qode_remove_yoast_json_on_ajax')) { /** * Function that removes yoast json ld script * that stops page transition to work on home page * Hooks to wpseo_json_ld_output in order to disable json ld script * @return bool * * @param $data array json ld data that is being passed to filter * * @version 0.2 */ function bridge_qode_remove_yoast_json_on_ajax($data) { //is current request made through ajax? if ( bridge_qode_qode_core_installed() && bridge_core_is_ajax() ) { //disable json ld script return array(); } return $data; } //is yoast installed and it's version is greater or equal of 1.6? if(defined('WPSEO_VERSION') && version_compare(WPSEO_VERSION, '1.6') >= 0) { add_filter( 'wpseo_json_ld_output', 'bridge_qode_remove_yoast_json_on_ajax' ); add_filter( 'disable_wpseo_json_ld_search', 'bridge_qode_remove_yoast_json_on_ajax' ); } }