Raruto
Forum Replies Created
-
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Parent eventsHi Will,
it depends on what exactly you want to do, but it should be feasible:
https://stackoverflow.com/questions/10750931/wordpress-how-to-add-hierarchy-to-postsRegards,
RarutoForum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Event durationHi Will,
here are some links that may help you:- https://pastebin.com/bgednURB
- https://wp-events-plugin.com/tutorials/create-your-own-event-scope/
- https://www.ads-software.com/support/topic/group-event-search-form-results-by-all-day-morning-afternoon-evening/
Regards,
RarutoFor the same reason I report here a similar error in the following template file:
events-manager/templates/buddypress/profile.php#L31
Bug Description:
Attending information must be visible on profile page only if the booking reservations are enabled. (currently they are always displayed, even if rsvp is disabled)How to fix it:
<?php if( get_option('dbem_rsvp_enabled') ) : ?><!-- Additional check condition --> <h4><?php _e("Events I'm Attending", 'events-manager'); ?></h4> <?php $EM_Person = new EM_Person( $bp->displayed_user->id ); $EM_Bookings = $EM_Person->get_bookings( false, apply_filters('em_bp_attending_status',1) ); if(count($EM_Bookings->bookings) > 0){ //Get events here in one query to speed things up $event_ids = array(); foreach($EM_Bookings as $EM_Booking){ $event_ids[] = $EM_Booking->event_id; } echo EM_Events::output(array('event'=>$event_ids)); }else{ ?> <p><?php _e('Not attending any events yet.','events-manager'); ?></p> <?php }?> <?php endif; ?>
“Events Manager 5.7.3” and “WordPress 4.8.1”
I also did a test from a fresh new install getting the same result..
Hi caimin,
I did some further tests (only with the plugin EM running) and I came to the following result.Due to the reasons explained by your article I already had these two functions in the functions.php:
function my_em_posttype_fix(){ register_taxonomy_for_object_type('category',EM_POST_TYPE_EVENT); register_taxonomy_for_object_type('category',EM_POST_TYPE_LOCATION); } add_action('init','my_em_posttype_fix',100);
function my_em_posttype_cat_default($EM_Object){ global $post; if( $post->post_type == EM_POST_TYPE_EVENT || $post->post_type == EM_POST_TYPE_LOCATION ){ $categories = get_the_category(); if( count($categories) == 0 ){ //assign a category to this wp_set_object_terms($post->ID, 'uncategorized','category'); } } } add_action('template_redirect','my_em_posttype_cat_default', 1,1);
Editing the first function, as follows, produces the duplication of the word “post” (or “post_post_category”, as described in the previous post):
function my_em_posttype_fix(){ $labels = array( 'name' => 'post_category', 'singular_name' => 'post_category', 'search_items' => 'Search post_category', 'all_items' => 'All post_category', 'parent_item' => 'Parent post_category', 'parent_item_colon' => 'Parent post_category:', 'edit_item' => 'Edit post_category', 'update_item' => 'Update post_category', 'add_new_item' => 'Add New post_category', 'new_item_name' => 'New post_category', 'menu_name' => 'post_category Categories', ); register_taxonomy('post_category',array(EM_POST_TYPE_EVENT), array( 'hierarchical' => true, 'labels' => $labels, 'query_var' => true )); register_taxonomy_for_object_type('category',EM_POST_TYPE_EVENT); register_taxonomy_for_object_type('category',EM_POST_TYPE_LOCATION); } add_action('init','my_em_posttype_fix',100);
From what I have been able to see, this issue specifically afflicts the category “post_category” (eg. with the “custom_category” there are no problems in keeping active the last two lines: “register_taxonomy_for_object_type”)
PS Can you confirm me that I can not use the default wordpress category “category” as EM search attribute? (if not modifying the plugin core..)
- This reply was modified 7 years, 6 months ago by Raruto.
Hi Angelo,
but in this pastebin.com/ you say that EM is perfectly able to automatically register new taxonomies as searchable within itself (without the need to create a custom event search attribute ..), in fact, I tried to create some new taxonomies such as “post_category” and “custom_category“, and the result is as follows:function my_em_own_taxonomy_register(){ register_taxonomy_for_object_type('custom_category',EM_POST_TYPE_EVENT); } add_action('init','my_em_own_taxonomy_register',100);
WORKING:
[events_list custom_category="featured"]
function my_em_own_taxonomy_register(){ register_taxonomy_for_object_type('post_category',EM_POST_TYPE_EVENT); } add_action('init','my_em_own_taxonomy_register',100);
NOT WORKING:
[events_list post_category="featured"]
WORKING:[events_list post_post_category="featured"]
This makes me think there is a kind of regex inside the plugin that should turn “category” into “post_category” (am I wrong?, according to what is written in the guide it would seem so…)
PS in particular I refer to the paragraphs “Exceptions: Post Tags and Categories,” “Using Custom Taxonomies in Searches”
- This reply was modified 7 years, 7 months ago by Raruto.