Support » Plugin: Events Manager - Calendar, Bookings, Tickets, and more! » Tags not saved when saving events

  • Resolved dennislloydjr

    (@dennislloydjr)


    Event tags are not saved when saving an event, unless an event category is also chosen. When creating or updating an event or recurring event, the event tags are not saved correctly. I have narrowed it down to this spot of code (lines 1841-1849 in events-manager\classes\em-event.php):

    $tax_slugs_count = count($categories);
    			 	foreach($post_ids as $post_id){
    					if( $cat_slugs_count > 0 && !EM_MS_GLOBAL ){
    						wp_set_object_terms($post_id, $cat_slugs, EM_TAXONOMY_CATEGORY);
    					}
    					if( $tax_slugs_count > 0 ){
    						wp_set_object_terms($post_id, $tax_slugs, EM_TAXONOMY_TAG);
    					}
    			 	}

    If the first line in this code block is changed to:
    $tax_slugs_count = count($tags);

    then the code works fine and updates the tags.

    Can this please be fixed in the next release? I’ve made the change locally on my installation, but I don’t want it to be overwritten in the next revision.

    Thank you for the excellent work!

    http://wordpress.org/extend/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • agelonwl

    (@angelonwl)

    hi,

    I tried this one and seems to be working fine; can I know what is your current EM version?

    Thread Starter dennislloydjr

    (@dennislloydjr)

    Thank you for the reply agelonwl, I have Version 5.3.6.1.

    You can see from the first line of code that I posted that something is clearly amiss. The number of tags should not be equal to a count of the categories. There is a section of categories processing just above this code and it was likely copy-pasted here to create the section for tags.

    agelonwl

    (@angelonwl)

    I see now, will look into this.

    UPDATE: this is already been fixed in the latest EM dev version.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Tags not saved when saving events’ is closed to new replies.