• What am doing wrong on pulling category ID’s in ver 5. Looks like this changed but not familiar enough to understand how to change it going forward.

    Here is what I had in EM ver 4

    global $EM_Category;
    $catname = $EM_Category->name; //get category name and store it
    $currentid = $EM_Category->id; //get and store the current category id

    $EM_Category->name; still pulls the category name but $EM_Category->id; does not pull the id.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    try to use $EM_Category->term_id

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    yes, now EM_Category is basically an extension of the object you get when you do get_term(), with added methods for use in EM

    I’ll make id = term_id just to avoid unecessary confusion in next beta, but if you can use term_id, better :=)

    similar concept in Event and Location objects, they should contain all post object fields alongside EM specific properties/methods.

    Thread Starter rontarson

    (@rontarson)

    So to continue on the below should be modified to $EM_Event->term_id; but what about get_categories() and get_ids()? Are these being updated as well?

    if (class_exists('EM_Events')) {
    	$currentid = $EM_Event->id; //get and store the current event id
    	$cats = $EM_Event->get_categories(); //get the categories for the current event
    	$cat_ids = $cats->get_ids(); //get the ids for the categories of the current event
    	$cat_ids_strg = implode(',', $cat_ids); //make a comma separated string of category ids

    @rontarson,

    get_categories() and get_ids() should be the same. Please advice if it doesn’t work!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Events Manager] EM ver 5 Beta 1 – Category ID Issue’ is closed to new replies.