• Resolved horseridingstable

    (@horseridingstable)


    Hello Roland,

    the booking ID always has a # in front of it. Can I change that via functions.php? For example, replace the # with a hyphen (-). Do you have any tips for me?

    Thank you in advance for your help.

    Best regards from Germany,
    Manfred

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Roland Murg

    (@murgroland)

    Hi Manfred,

    You can use the {Unformatted Booking ID} dynamic tag for this.

    Plugin Author Roland Murg

    (@murgroland)

    Sorry, i just re-read your message and noticed you want to replace the #, not remove it. You can either use the tag i mentioned above and manually add a hyphen before it, or you can create your own dynamic tag, you can find instructions here: https://www.wpbookingsystem.com/documentation/creating-custom-dynamic-tags/

    So something like this:

    add_filter('wpbs_dynamic_tag', function($content, $tag, $data){

    // Check what tag we are replacing
    if ($tag != '{Custom Booking ID}') {
    return $content;
    }

    $id = '-' . $data['booking']->get('id');

    return str_replace($tag, $id, $content);

    }, 10, 3);
    Thread Starter horseridingstable

    (@horseridingstable)

    Hello Roland. Thank you very much for your quick reply.
    Unfortunately, the code doesn’t work.
    Do you have any idea what could be causing this?
    Would something like this perhaps be possible to integrate?

    // Define prefixes per form
    $prefix_map = [
    1 => 'AB-', // Form ID 1
    2 => 'CD-', // Form ID 2
    3 => 'XY-', // Form ID 3
    ];


    Best regards

    Plugin Author Roland Murg

    (@murgroland)

    Yes, it’s possible, could you please send an email at [email protected] mentioning this ticket? I need to send you an updated version of the plugin as well 🙂

    Thread Starter horseridingstable

    (@horseridingstable)

    Okay, I’ll do that. No update is being shown to me: I thought I had the latest version — “WP Booking System Premium 5.12.3.”

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Booking-ID without #’ is closed to new replies.