Support

Home Forums Event Espresso Premium POst meta data to event status

POst meta data to event status

Posted: October 5, 2017 at 8:43 pm

Viewing 3 reply threads


rhumphrey

October 5, 2017 at 8:43 pm

Hi, can you point me in the right direction for finding which table i can find the event status. so for example i need to find where the status of sold out is located so i can configure my search and filter plugin to look up in the correct place. currently i have looked in the _EVENT_STATUS, but when i search i only see a single option in there.

hope this makes sense, if you can give me some pointers that would be great.

thanks


Josh

  • Support Staff

October 6, 2017 at 7:25 am

Hi Ryan,

That’s actually in the wp_posts table which has the post_status field. When an event is sold out its post_status changes to sold_out.

You can use the get_post_status() function to retrieve the post’s status.


rhumphrey

October 9, 2017 at 2:54 am

Thanks for the info josh, this is the reply from the developer that create the search filter plugin that i use.

I do not think that this is going to be possible, at least not directly. The reason is two-fold. The first is that we index/filter meta data stored in the post_meta table, but this value is not stored in that table. As you say, this data is stored in the posts table, and it is stored as a WordPress array in that field.

It is accessed by the WordPress get_post_status() function:

https://codex.wordpress.org/Function_Reference/get_post_status

To allow front end (user) access to this would be dangerous, as it would allow spoofing of the search query to show private posts. As such, it is not the most sensible of places to place such data. A custom meta field would have been a much better choice for the Event Espresso plugin authors. I would have thought that this would not be a difficult bit of coding for them to do, with a settings choice for the user to select which option they want to use.

many thanks

Ryan


Josh

  • Support Staff

October 10, 2017 at 9:45 am

Hi Ryan,

I’m afraid their suggestion to store post statuses outside of the post_status field isn’t something that Event Espresso can do, and adding an option to toggle where post_statuses are stored isn’t a viable option.

If the developer of the search plugin wants to discuss this further with the Event Espresso developer team, they’re welcome to open an issue on github:

https://github.com/eventespresso/event-espresso-core/issues

Viewing 3 reply threads

The support post ‘POst meta data to event status’ 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