Problems with hijacking the post by this plugin
-
Hi,
I used the events calendar on several sites, mostly genesis using child themes, and found there are some problems in themes that use a page image and title in the header above the content. I’ve performed some customizations to the themes to get it working somewhat, but lately I dove some more into it.
To my suprise the TEC plugin actively blocks the theme of showing post info or an image beloving to an event post, by replacing the post object by a mock object. That is problem for me, because there seems to be no other way of blocking that behaviour then changing some code in the plugin. And then after every update I have to again change that code.
I’m trying to retain as much as possible of the genesis hooks and functionality (like sidebars and the page header), so I first changed the settings to use the normal page template of the theme, but then the featured image is not used, and I need to stop TEC from blanking out the post object.
Right now all seems to work well when I comment out line 240 and 241
in\wp-content\plugins\the-events-calendar\src\Tribe\Views\V2\Template\Page.php
// Replace the Mocked post in a couple of places. // $GLOBALS['post'] = $mocked_post; // $wp_query->posts = [ $mocked_post ]; $wp_query->post_count = count( $wp_query->posts );
What plugin decides to block theme functionality this way? I don’t understand how you can think this is a good idea? Actively hijacking the theme without installing an obvious way to stop that behaviour? It cost me a lot of time to even find out that TEC did this. Not cool.
I know the target audience of genesis and TEC likes coding, but I don’t like code that must be manually changed (and remembered) after every update.
At least I now understand why a theme like Essence Pro (Studiopress) has had so much trouble displaying the correct page-title and why Breaktrough Pro doesn’t display the header image by default in event pages. It’s been an active sabotage of those theme’s functionality.
Is this something you may reconsider? Please do, or give a workable alternative to manage this problem, without having to change the code after every update.
Thanks,
Hans
The page I need help with: [log in to see the link]
- The topic ‘Problems with hijacking the post by this plugin’ is closed to new replies.