I’m currently using this to get a list of associated categories for my event listings:
[code language=”php”] $programs_string = do_shortcode(‘[CATEGORY_NAME event_id=”‘.$event_id.'”]’);
$programs_array = explode(‘,’, $programs_string );[/code]
This would usually work great, except that some of my categories have commas in them, so using a comma delimiter is not going to work in this case. Is there a more direct public function that I can use to get an array of categories, not a string?
This topic was modified 11 years, 3 months ago by marketing.
This topic was modified 11 years, 3 months ago by marketing.
This topic was modified 11 years, 3 months ago by marketing.
This topic was modified 11 years, 3 months ago by marketing.
This topic was modified 11 years, 3 months ago by marketing.
In replacing the comma with a pipe, I was able to successfully use the php explode() function to get a true array of categories, including those with commas in them.
Viewing 2 reply threads
The support post ‘Alternative Function to [CATEGORY_NAME] Shortcode’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.