Support

Home Forums Event Espresso Premium how to set a category for an event

how to set a category for an event

Posted: November 2, 2016 at 8:08 pm

Viewing 1 reply thread


elemento2

November 2, 2016 at 8:08 pm

I am trying to add the category into the new added/updated event
so I have my metabox setup and everything
this is my save code

        $_categories_slug =  $_POST["evt-cat-eo2"];
		$_categories = get_term_by( 'slug', $_categories_slug,'espresso_event_categories' );
		$term_ids = (array) $_categories->term_id;
		wp_set_post_categories( $post_id,$term_ids,false ) ; 

but it doesn’t seems to work


elemento2

November 2, 2016 at 10:57 pm

use wp_set_object_terms insted

Viewing 1 reply thread

The support post ‘how to set a category for an event’ 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