flexkeller
Forum Replies Created
-
Here is a short code to “Restricts EventPrime Attendees List to users with specific roles”.
Compatible with Members Plugin (https://memberpress.com/
<?php
/**
* Restricts EventPrime Attendees List to users with specific roles
*
* Compatible with Members Plugin (MemberPress Free)
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Removes the attendees list display for unauthorized users
*/
function ep_restrict_attendees_list_by_role() {
if ( ! is_user_logged_in() ) {
ep_remove_attendees_list_hook();
return;
}
$current_user = wp_get_current_user();
// Define allowed roles (add or remove as needed)
$allowed_roles = array(
'contributor',
'author',
'editor',
'administrator'
);
$has_access = false;
foreach ( $allowed_roles as $role ) {
if ( in_array( $role, (array) $current_user->roles ) ) {
$has_access = true;
break;
}
}
if ( ! $has_access ) {
ep_remove_attendees_list_hook();
}
}
/**
* Removes the attendees list hook from the single event page
*/
function ep_remove_attendees_list_hook() {
add_action( 'wp', function() {
global $wp_filter;
if ( isset( $wp_filter['ep_after_single_events_description'] ) ) {
foreach ( $wp_filter['ep_after_single_events_description']->callbacks as $priority => $callbacks ) {
foreach ( $callbacks as $key => $callback ) {
if ( is_array( $callback['function'] ) &&
is_object( $callback['function'][0] ) &&
get_class( $callback['function'][0] ) === 'Eventprime_Attendees_List_Public' &&
$callback['function'][1] === 'ep_al_show_attendees_list' ) {
remove_action( 'ep_after_single_events_description', $callback['function'], $priority );
}
}
}
}
}, 1 );
}
add_action( 'init', 'ep_restrict_attendees_list_by_role', 20 );I create all events for our staff.
I select the appropriate leader, location, time, etc.
We do not work with the “submitted through the Frontend Event Submission form”.Forum: Plugins
In reply to: [EventPrime – Events Calendar, Bookings and Tickets] Limited ticketsalmost…
I like to have:Experienced Diver Ticket – This ticket type should have unlimited capacity, allowing any number of participants to book.
2 different New Scuba Diver Ticket (new diver with guide AND new diver doining a checkdive)
– each ticket type should have a maximum capacity of 2, BUT the total should be 2 (not 4)
So 2 of one type or 1 of each- This reply was modified 6 months, 2 weeks ago by flexkeller.
Forum: Plugins
In reply to: [EventPrime – Events Calendar, Bookings and Tickets] Limited ticketsI got it. somehow…
We have Events that are unlimited for experienced divers, but limited to 2 newly baked ScubaDiver (as one instructor only handels 2 divers… So I would need the “Maximum Ticket per Order” only on one Ticket Category that holds 2 different Ticket-Types…
Forum: Plugins
In reply to: [EventPrime – Events Calendar, Bookings and Tickets] Link in Checkout-Field?Is it possible to set this once.
We have the same T&C for all events/courses. So it would be much easier.
It only happens to copied events.
If I make a new event it works fine.Thanks.
1.
Can I change 31/10/2025 to 31.10.2025? Dates with / are only used in CAN/USA
(Why not just use systemsettings …/wp-admin/options-general.php)2.
The recurring dates on the right (above the booking knob) are still without yearAny idea how to solve this?
My problem/question ist not “Resolved”
- This reply was modified 7 months, 3 weeks ago by flexkeller.
I’ve already tried this. But it shows a calendar-view with only the selected events.
I like to have the “regular” view as[em_event_type id="24950" event_style="rows" event_limit="10" load_more="1" hide_past_events="1"]would.Forum: Plugins
In reply to: [EventPrime – Events Calendar, Bookings and Tickets] Checkout fields twice…Claude made me a code to put the “firstname” and “lastname” entries in the corresponding guest-booking-fields. Maybe that helps some of you.
add_action('wp_footer', 'sync_booking_fields_script');
function sync_booking_fields_script() {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
function syncFields() {
var vornameField = $('input[name="ep_booking_booking_fields[1][vorname]"]');
var firstNameField = $('input[name="ep_booking_guest_booking_field[ep_gb_first_name]"]');
var nachnameField = $('input[name="ep_booking_booking_fields[2][nachname]"]');
var lastNameField = $('input[name="ep_booking_guest_booking_field[ep_gb_last_name]"]');
vornameField.on('input keyup change', function() {
firstNameField.val($(this).val());
});
nachnameField.on('input keyup change', function() {
lastNameField.val($(this).val());
});
if (vornameField.val()) {
firstNameField.val(vornameField.val());
}
if (nachnameField.val()) {
lastNameField.val(nachnameField.val());
}
}
syncFields();
setTimeout(syncFields, 1000);
$(document).ajaxComplete(function() {
syncFields();
});
});
</script>
<?php
}
add_action('init', 'sync_booking_fields_on_submit');
function sync_booking_fields_on_submit() {
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['ep_booking_booking_fields'][1]['vorname'])) {
$_POST['ep_booking_guest_booking_field']['ep_gb_first_name'] =
$_POST['ep_booking_booking_fields'][1]['vorname'];
}
if (isset($_POST['ep_booking_booking_fields'][2]['nachname'])) {
$_POST['ep_booking_guest_booking_field']['ep_gb_last_name'] =
$_POST['ep_booking_booking_fields'][2]['nachname'];
}
}
}Forum: Plugins
In reply to: [EventPrime – Events Calendar, Bookings and Tickets] Event-View 100% width?I extended the css to have the picture also 100% wide:
#top.ep-event-detail-template .fullsize .template-blog .post .entry-content-wrapper {
max-width: 100% !important;}
#top.ep-event-detail-template .fullsize .template-blog .post .entry-content-wrapper .entry-content {
max-width: 100%;}
#top.ep-event-detail-template .ep-single-event-slide-container {
max-width: 100% !important;
width: 100% !important;
margin-left: 0 !important;
margin-right: 0 !important;}
#top.ep-event-detail-template .ep-single-event-slide-container img,
#top.ep-event-detail-template #ep_single_event_image {
width: 100% !important;
max-width: 100% !important;
height: auto !important;
margin: 0 !important;
display: block !important;}Forum: Plugins
In reply to: [EventPrime – Events Calendar, Bookings and Tickets] Phone-number?it looks like this was the only version I didn’t tried… 😉
Sorry.Forum: Plugins
In reply to: [EventPrime – Events Calendar, Bookings and Tickets] Phone-number?Sorry. I got it:
.ep-event-image a {
display: flex;
justify-content: center;
align-items: center;
overflow: visible !important;
}
.ep-event-image img {
width: auto !important;
height: auto !important;
max-width: 100%;
max-height: 100%;
object-fit: contain !important;
border-radius: 0 !important;
}- This reply was modified 8 months, 2 weeks ago by flexkeller.
Do you already solved this?