Edit bookings column values

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 9 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9962

    Hi Is there anyway to edit the booking table columns without editing the plugins core files?

    At the moment the plugin displays the bookee as just their username, I want to add a user meta field alongside their username on both the bookings table and individual booking admin pages.

    Thanks

    Sam
    #11556

    Hi Sam,

    Sorry, this one slipped the radar. Unfortunately there is no hook for editing the booking form column details, but the bookee’s name is their display name (for logged-in users, this is the display name as set in their profile). There is a filter for editing this:

    eventorganiser_get_booking_meta_bookee_display_name

    Which passes the bookee’s display name and the booking ID. For example:

    add_filter( 'eventorganiser_get_booking_meta_bookee_display_name', 'my_bookee_display_name', 10, 2 );
    function my_bookee_display_name( $display_name, $booking_id ){
         // Change $display_name as required
         // $bookee_id = eo_get_booking_meta( $booking_id, 'bookee' ); //User ID, 0 if its a guest booking
          return $display_name;
    }
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.