Support

Home Forums Event Espresso Premium Possible Namespace collision with global $post issue

Possible Namespace collision with global $post issue

Posted: March 15, 2024 at 11:29 am

Viewing 1 reply thread


Daniel

March 15, 2024 at 11:29 am

Hi!
Seeing all of the reports about the latest EE release.
I had serious issues too. I’ve resolved them all by modifying my code to handle the issues… they all seem to stem from the fact that the global $post variable is not available to the Event View so static function access can’t reach it.

At least that’s my hunch.

I was forced to update all get_event() calls to pass an explicit ID.

`
<?php

use EventEspresso\core\domain\entities\custom_post_types\EspressoPostType;

/**
* EEH_Event_View Helper
*
* @package Event Espresso
* @subpackage /core/
* @author Brent Christensen
*/
class EEH_Event_View extends EEH_Base
{
private static ?EE_Event $_event = null;

/**
* get_event
* attempts to retrieve an EE_Event object any way it can
*
* @param int|WP_Post $EVT_ID
* @return EE_Event|null
* @throws EE_Error
* @throws ReflectionException
*/
public static function get_event($EVT_ID = 0)
{
// international newspaper?
global $post;
`


Rio

  • Support Staff

March 16, 2024 at 12:06 am

Thanks for sharing this. If it happen they’re some conflict, you can revert back to 5.0.17, here is the download link

thanks

Viewing 1 reply thread

The support post ‘Possible Namespace collision with global $post issue’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso