Support

Home Forums Event Espresso Premium DB Table field post_content not matching page content

DB Table field post_content not matching page content

Posted: December 7, 2018 at 8:27 am


ICLE

December 7, 2018 at 8:27 am

I have to develop queries to pull event information directly from the database for display on an external site. I have located the event name in the _posts table in the post_title field. The description of the event appears to be stored in the post_content field of the _posts table. However, the post_content column contains 6 or 8 html DIV wrapper tags around the actual content. When I inspect the content on the wordpress page those wrapper DIV tags are not part of the html.

There is only one matching record in the _post table so I have to be looking at the correct record.

I am trying to understand what happened to all of the html that appears to have been stripped out. I don’t want or need that html for my purposes but I am wondering if there is perhaps another table besides _posts where this event description is coming from?

My other question is, is there someplace in the php code that I can find the queries being run that generates the content on the event page?

Thank you!


ICLE

December 7, 2018 at 8:31 am

Sorry….we are running Event Espresso – 4.9.73.p on wordpress 5.


Josh

  • Support Staff

December 7, 2018 at 9:25 am

Hi,

Quite likely, a filter on the_content stripped the html before it’s output to the web page. Sometimes a theme will do that.

What you could do instead, since this is an external site, is use the REST API to pull that information.

Here’s an example of a REST API request to our demo site:
http://demoee.org/use-cases/wp-json/ee/v4.8.36/events/3812

Here’s a link to the documentation about building REST API queries for events:
https://github.com/eventespresso/event-espresso-core/blob/master/docs/C–REST-API/README.md

Here’s an example plugin that adds a shortcode that can be used to display a list of events on an external site:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/shortcodes/jf_other_site_event_list.php


ICLE

December 10, 2018 at 12:46 pm

Josh,

Thank you for the help! The documentation for the API says:

Which fields are available for querying?
Use any field name of the entity you’re currently querying. For example, if querying for answers, you can either use “ANS_ID” or “ANS_value”. Please see the section on “Entities” to see what fields are available.

But nowhere does the documentation give any clue on where to look for the entities. Can you send me a link please to where I can see what entities are available for query?

Specifically, I want to return every event that is both “active” and “upcoming”

Thank you


ICLE

December 10, 2018 at 1:37 pm

One more question. We installed the “advanced custom fields” plug-in. Do you know if the API will return those fields we add via the plug-in?


Josh

  • Support Staff

December 10, 2018 at 3:07 pm

Can you send me a link please to where I can see what entities are available for query?

To see what entities exist, send a request to
https://{your domain}/wp-json/ee/v4.8.36/resources
you could open this link to see the resources from one of our servers:
https://demoee.org/use-cases/wp-json/ee/v4.8.36/resources

The above link is best opened using an app like Postman or similar.

Specifically, I want to return every event that is both “active” and “upcoming”

“active” and “upcoming” are not actually event entities. The code I shared with you shows exactly how to get activate and upcoming events, specifically this line:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/shortcodes/jf_other_site_event_list.php#L17

Do you know if the API will return those fields we add via the plug-in?

Yes, it does. Post Meta fields are protected so you’ll need to include some authorization with the request. Event Espresso includes the Basic Auth plugin so if the request includes Basic Auth headers, you can do something like this to get an event’s custom fields:

https://{site domain}/wp-json/ee/v4.8.36/events/{event ID}/post_metas

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: publish

Updated by  Josh 2 days, 8 hours ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!