wp-event-manager
wp-event-manager copied to clipboard
Issue in the field editor.
when he create a field in the field editor with following settings:
- Type: "Term Select"
- Placeholder / Options:
it doesn't show up in the "add new event" fields.
issue vedio I've uploaded it to youtube: https://www.youtube.com/watch?v=nrZ1TrQHRlo
#18821 Daniel Wagner
the codes which he used to add Hey,
Here is a example of the taxonomy creation:
public function register_taxonomies() { if (!taxonomy_exists('user_taxonomy')) { register_taxonomy( 'user_taxonomy', array('zoho-crm-event', 'event_listing'), // 'event_listing' is the post type for WP-Event-Manager array( 'label' => __('Users', 'textdomain'), 'rewrite' => array('slug' => 'user'), 'hierarchical' => true, 'show_ui' => false, ) ); } if (!term_exists('User', 'user_taxonomy')) { wp_insert_term('User', 'user_taxonomy'); } if(!taxonomy_exists('contact_taxonomy')) { register_taxonomy( 'contact_taxonomy', array('zoho-crm-event', 'event_listing'), // 'event_listing' is the post type for WP-Event-Manager array( 'label' => __('Contacts', 'textdomain'), 'rewrite' => array('slug' => 'contact'), 'hierarchical' => true, 'show_ui' => false, ) ); } if (!term_exists('Contact', 'contact_taxonomy')) { wp_insert_term('Contact', 'contact_taxonomy'); } if (!taxonomy_exists('host_country_taxonomy')) { register_taxonomy( 'host_country_taxonomy', array('zoho-crm-event', 'event_listing'), // 'event_listing' is the post type for WP-Event-Manager array( 'label' => __('Host Countries', 'textdomain'), 'rewrite' => array('slug' => 'host-country'), 'hierarchical' => true, 'show_ui' => false, ) ); } if (!term_exists('Host Country', 'host_country_taxonomy')) { wp_insert_term('Host Country', 'host_country_taxonomy'); } }
Example of post creation and assignment to taxonomy /* HOST COUNTRIES / foreach ($data['hostcountries'] as $hostcountry) { $existing_post = post_exists(wp_strip_all_tags($hostcountry['Name'])); if(!$existing_post) { $post_id = wp_insert_post([ 'post_title' => wp_strip_all_tags($hostcountry['Name']), 'post_type' => 'zoho-crm-event', 'post_status' => 'publish', ]); wp_set_object_terms($post_id, 'Host Country', 'host_country_taxonomy'); } else { wp_update_post([ 'ID' => $existing_post, 'post_title' => wp_strip_all_tags($hostcountry['Name']), 'post_type' => 'zoho-crm-event', 'post_status' => 'publish', ]); } } / HOST COUNTRIES END */