joneiseman
Forum Replies Created
-
Here’s the documentation: https://wp-events-plugin.com/documentation/recurring-events/
When I edit a recurring event it says: Modifications to event dates will cause all recurrences of this event to be deleted and recreated, previous bookings will be deleted.
But you can make other edits to the recurring event that doesn’t involve changing the dates.
WARNING: This is a recurring event.
Modifications to recurring events will be applied to all recurrences and will overwrite any changes made to those individual event recurrences.
Bookings to individual event recurrences will be preserved if event times and ticket settings are not modified.
I’m not able to right click on the page to view the html/css.
Did you disable any of the formatting in Events Manager in Events > Settings and then in the General tab: Styling Options (Advanced)?
Here’s a way to register a new shortcode to do this without modifying any template files. Just add the following code snippet:
add_shortcode('events_list_searchform', 'my_events_list_searchform');
function my_events_list_searchform($args = []) {
$selector = 'form#em-search-form-' . $args['id'] . ' button.em-search-submit';
$args = em_get_search_form_defaults($args);
$args['search_action'] = 'search_events';
$args['search_url'] = get_option('dbem_events_page') ? get_permalink(get_option('dbem_events_page')):EM_URI;
$args['css_classes'][] = 'em-events-search';
$args['css_classes_advanced'][] = 'em-events-search-advanced';
if (!empty($args['scope']['name'])) $args['scope'] = $args['scope']['name'];
$script = '<script>
jQuery(document).ready( function($){
$(window).on("load", function() {
$("' . $selector . '").click();
});
})</script>';
ob_start();
em_locate_template('templates/search.php', true, array('args'=>$args));
return ob_get_clean() . $script;
}You can then use the [events_list_searchform] shortcode instead of [events_list] (it takes the same search attributes).
You can use the Code Snippets plugin to add this code snippet.
Try adding the following to your wp-config.php file:
define( 'EM_AJAX', false );
Let’s say you already assigned the existing members a role that has the edit_events and and edit_other_events capability. Let’s call that role “member”. You could then add a code snippet to assign the member role when someone becomes a member or removes the member role when they are no longer a member.
add_action('pmpro_after_change_membership_level', 'my_change_membership_level', 10, 3);
function my_change_membership_level($level_id, $user_id, $old_level)
{
$user = get_userdata($user_id);
if (!$user)
return;
if (false !== $level_id && $level_id > 0) {
$user->add_role('member');
}
else {
$user->remove_role('member');
}
}You could use the Code Snippets plugin to add this code snippet.
You can use the Members plugin to create roles and to assign roles to users.
When they don’t have the edit_events capability, the “Add New” button will not appear.
Here’s an improved version that handles the javascript in the correct way and will work in the case when the shortcode is instantiated more than once on the same page:
$selector = $args['id'] . ' button.em-search-submit';
wp_enqueue_script( $args['id'] );
wp_add_inline_script( $args['id'],
'
jQuery(document).ready( function($){
$(window).on("load", function() {
$("' . $selector . '").click();
});
});
');
/* @var $args array */
$args['search_action'] = 'search_events';
$args['search_url'] = get_option('dbem_events_page') ? get_permalink(get_option('dbem_events_page')):EM_URI;
$args['css_classes'][] = 'em-events-search';
$args['css_classes_advanced'][] = 'em-events-search-advanced';
if (!empty($args['scope']['name'])) $args['scope'] = $args['scope']['name'];
em_locate_template('templates/search.php', true, array('args'=>$args));
?>If you do instantiate the shortcode more than once it might be a good idea to specify a unique id for each shortcode (but it’s not necessary). For example:
[events_search_form id=1 full="1" has_search="1" sorting="0" show_advanced="0" search_geo="0" show_search="1" long_events="1" category=12]
[events_search_form id=2 full="1" has_search="1" sorting="0" show_advanced="0" search_geo="0" show_search="1" long_events="1" category=13]I came up with a solution to this problem using the event_search_form shortcode: https://www.ads-software.com/support/topic/search-not-working-with-events_list/#post-18140767
[event_search_form view="grid" pagination=1]
It requires overriding the events_search.php template.
Here’s an improved version.
First create the directory wp-content/plugin-templates/events-manager/templates and then create a file in that directory called events-search.php with the following content:
<script>
jQuery(document).ready( function($){
$(window).on('load', function() {
$('button.em-search-submit').click();
});
});
</script>
<?php
/* @var $args array */
$args['search_action'] = 'search_events';
$args['search_url'] = get_option('dbem_events_page') ? get_permalink(get_option('dbem_events_page')):EM_URI;
$args['css_classes'][] = 'em-events-search';
$args['css_classes_advanced'][] = 'em-events-search-advanced';
if (!empty($args['scope']['name'])) $args['scope'] = $args['scope']['name'];
em_locate_template('templates/search.php', true, array('args'=>$args));
?>Then you can use the following shortcode:
[event_search_form full="1" has_search="1" sorting="0" show_advanced="0" search_geo="0" show_search="1" long_events="1"]
This is the same problem reported here: https://www.ads-software.com/support/topic/please-fix-broken-calendar-category-filtering/
I reported this to @msykes
If I comment out line 127 in wp-content/plugins/ninjafirewall/lib/utils.php it fixes the problem
// add_filter('wp_insert_post_empty_content', 'nf_wp_insert_post_empty_content', 10000, 2 );
So, I guess the problem is related to that filter.
I verified the problem but I’m not able to determine what is causing the incompatibility.
I hope so.
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Events by locationThe search parameters are documented here: https://wp-events-plugin.com/documentation/event-search-attributes/
It says the location search parameter takes a location ID. So, the slug or location name will not work. To find the location ID go to Events > Locations and then in Screen Options enable Location ID.
I verified using the location ID works for both the events_list and events_calendar shortcodes.
You could change line 218 of em-calendar.php from this:
if( $args['calendar_size'] === 'large' ) {
To this:
if( array_key_exists( 'calendar_size', $args ) && $args['calendar_size'] === 'large' ) {
And then hope that the plugin owner fixes this in the next release.
Yes, I believe this is a bug. Here’s a hack to do what you want (definitely not ideal).
First create the directory wp-content/plugin-templates/events-manager/templates and then create a file in that directory called events-search.php with the following content:
<script>
jQuery(document).ready( function($){
$(window).on('load', function() {
$('.em-search-submit').click();
});
});
</script>
<?php
/* @var $args array */
$args['sorting'] = 0;
$args['long_events'] = 1;
$args['full'] = 1;
$args['search_geo'] = 0;
$args['show_advanced'] = 0;
$args['search_action'] = 'search_events';
$args['search_url'] = get_option('dbem_events_page') ? get_permalink(get_option('dbem_events_page')):EM_URI;
$args['css_classes'][] = 'em-events-search';
$args['css_classes_advanced'][] = 'em-events-search-advanced';
em_locate_template('templates/search.php', true, array('args'=>$args));
?>Then use the [event_search_form] shortcode.
You could try setting the parameters in the [event_search_form] shortcode instead of in events_search.php