Last active
November 16, 2022 12:55
Example of how to remove/re-add EE's filter on the_content when using Avada.
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 // Do not include the opening PHP tag if you already have one. | |
add_action('awb_remove_third_party_the_content_changes', 'tw_ee_avada_remove_filters', 10); | |
function tw_ee_avada_remove_filters() { | |
remove_filter( | |
'the_content', | |
array('EED_Event_Single', 'event_details'), | |
EED_Event_Single::EVENT_DETAILS_PRIORITY | |
); | |
remove_filter( | |
'the_content', | |
array('EED_Events_Archive', 'event_details'), | |
EED_Events_Archive::EVENT_DETAILS_PRIORITY | |
); | |
} | |
add_action('awb_readd_third_party_the_content_changes', 'tw_ee_avada_readd_filters', 20); | |
function tw_ee_avada_readd_filters() { | |
if ( | |
is_single() && | |
'espresso_events' == get_post_type() | |
) { | |
add_filter( | |
'the_content', | |
array('EED_Event_Single', 'event_details'), | |
EED_Event_Single::EVENT_DETAILS_PRIORITY | |
); | |
} | |
if(is_post_type_archive('espresso_events')) { | |
add_filter( | |
'the_content', | |
array('EED_Events_Archive', 'event_details'), | |
EED_Events_Archive::EVENT_DETAILS_PRIORITY | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment