Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- This snippet changes the dropdown for selecting a user for adding a booking manually to show usernames instead of their full name.
- for more information on adding this snippet to your site, see here
- http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
- */
- function my_em_mod_change_manual_booking_userddm(){
- add_filter('em_locate_template', function( $located, $template_name ){
- if( $template_name == 'placeholders/bookingform.php'){
- remove_action('em_booking_form_custom', array(EM_Gateways::get_gateway('offline'),'em_booking_form_custom'), 1);
- add_action('em_booking_form_custom', 'my_offline_em_booking_form_custom', 1);
- }
- return $located;
- }, 10, 2);
- }
- add_action('em_bookings_manual_booking', 'my_em_mod_change_manual_booking_userddm', 1);
- function my_offline_em_booking_form_custom(){
- ?>
- <p>
- <?php
- $person_id = (!empty($_REQUEST['person_id'])) ? $_REQUEST['person_id'] : false;
- wp_dropdown_users ( array ('name' => 'person_id', 'show' => 'user_login', 'show_option_none' => __ ( "Selectxxx a user, or enter a new one below.", 'em-pro' ), 'selected' => $person_id ) );
- ?>
- </p>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement