Forum Replies Created
-
AuthorPosts
-
Andy Clements
ParticipantI think I finally figured this out with the following code:
// determine if the current page is a tribe page function is_tribe_page() { $queried_object = get_queried_object(); $post_id = isset($post) ? $post->ID : (isset($queried_object->ID) ? $queried_object->ID : 0); $term_id = isset($queried_object->term_id) ? $queried_object->term_id : 0; if (function_exists("tribe_is_month") && tribe_is_month() && !is_tax()) { return array( "archive" => true, "view" => "month", "taxonomy" => false, "term_id" => 0, ); } elseif (function_exists("tribe_is_month") && tribe_is_month() && is_tax()) { return array( "archive" => true, "view" => "month", "taxonomy" => true, "term_id" => $term_id, ); } elseif (function_exists("tribe_is_past") && tribe_is_past() && !is_tax()) { // List View Page return array( "archive" => true, "view" => "list", "mode" => "past", "taxonomy" => false, "term_id" => 0, ); } elseif (function_exists("tribe_is_upcoming") && tribe_is_upcoming() && !is_tax()) { return array( "archive" => true, "view" => "list", "mode" => "upcoming", "taxonomy" => false, "term_id" => 0, ); } elseif (function_exists("tribe_is_past") && tribe_is_past() && is_tax()) { return array( "archive" => true, "view" => "list", "mode" => "past", "taxonomy" => true, "term_id" => $term_id, ); } elseif (function_exists("tribe_is_upcoming") && tribe_is_upcoming() && is_tax()) { return array( "archive" => true, "view" => "list", "mode" => "upcoming", "taxonomy" => true, "term_id" => $term_id, ); } elseif (function_exists("tribe_is_week") && tribe_is_week() && !is_tax()) { return array( "archive" => true, "view" => "week", "taxonomy" => false, "term_id" => 0, ); } elseif (function_exists("tribe_is_week") && tribe_is_week() && is_tax()) { return array( "archive" => true, "view" => "week", "taxonomy" => true, "term_id" => $term_id, ); } elseif (function_exists("tribe_is_day") && tribe_is_day() && !is_tax()) { return array( "archive" => true, "view" => "day", "taxonomy" => false, "term_id" => 0, ); } elseif (function_exists("tribe_is_day") && tribe_is_day() && is_tax()) { return array( "archive" => true, "view" => "day", "taxonomy" => true, "term_id" => $term_id, ); } elseif (function_exists("tribe_is_map") && tribe_is_map() && !is_tax()) { return array( "archive" => true, "view" => "map", "taxonomy" => false, "term_id" => 0, ); } elseif (function_exists("tribe_is_map") && tribe_is_map() && is_tax()) { // Map View Category Page return array( "archive" => true, "view" => "map", "taxonomy" => true, "term_id" => $term_id, ); } elseif (function_exists("tribe_is_photo") && tribe_is_photo() && !is_tax()) { // Photo View Page return array( "archive" => true, "view" => "photo", "taxonomy" => false, "term_id" => 0, ); } elseif (function_exists("tribe_is_photo") && tribe_is_photo() && is_tax()) { // Photo View Category Page return array( "archive" => true, "view" => "photo", "taxonomy" => true, "term_id" => $term_id, ); } elseif (function_exists("tribe_is_event") && tribe_is_event() && is_single()) { // Single Events return array( "single" => true, "post_type" => "tribe_events", "post_id" => $post_id, ); } elseif (function_exists("tribe_is_venue") && tribe_is_venue()) { // Single Venues return array( "single" => true, "post_type" => "tribe_venue", "post_id" => $post_id, ); } elseif (get_post_type() === "tribe_organizer" && is_single()) { // Single Organizers return array( "single" => true, "post_type" => "tribe_organizer", "post_id" => $post_id, ); } else { return false; } } // remove wpautop from tribe events pages function tribe_remove_content_filters() { if (is_tribe_page()) { remove_filter("the_content", "wpautop", 12); remove_filter("acf_the_content", "wpautop", 12); } } add_action("loop_start", "tribe_remove_content_filters", 999);Andy Clements
ParticipantTo be clear, the hook
tribe_events_templatesis a custom one that I want to add to my theme; the name can change if it needs to, that doesn’t particularly matter.December 18, 2017 at 12:32 pm in reply to: How can I load in Tribe templates without applying the `the_content` filter? #1408137Andy Clements
ParticipantI just gave that a try; this doesn’t really solve the problem because I still want to apply my filters to the content output for each individual event, just not for all markup that’s output by Tribe Events.
I guess it’s kind of hard to get across clearly what I mean, let me know if that doesn’t make sense.
December 11, 2017 at 12:47 pm in reply to: How can I load in Tribe templates without applying the `the_content` filter? #1403149Andy Clements
ParticipantI want to prevent Tribe Events from loading in via the_content() and instead manually load them myself. I believe this is the line of code that I need to disable, but I can’t figure out how:
Tribe/Templates.php:292
add_filter( 'the_content', array( __CLASS__, 'load_ecp_into_page_template' ) );Andy Clements
ParticipantThanks so much, that did the trick 🙂
-
AuthorPosts
