Hey everybody, are you looking forward to changing the default trip code precisely?

Well, we have covered the step-by-step procedure below. Please follow the instructions to change the default trip code in WP Travel

Useful article: Explore the WP Travel Shortcodes: [Complete List]

Steps to Change the Default Trip Code in WP Travel

Step 1: Use the given filter

To change the default trip code that is generated by the plugin you can use the  filter given below:

wp_travel_trip_code

Step 2: Activate the child theme using plugin below

To execute this you need to activate the child theme. You can create the child theme manually or simply create the child theme using the plugin given below:

You might be interested: How to create a child theme? (With Video Tutorial)

Step 3: Add the given code at functions.php in your child theme

After activating the child theme in your child theme functions.php add the below-given code.

add_action( 'init', function() {

   function wp_travel_child_change_trip_code( $code, $trip_id ) {
        return 'YOUR TRIP CODE  ' . $trip_id;
   }
   add_filter( 'wp_travel_trip_code','wp_travel_child_change_trip_code', 10, 2);
} );

Here replace ‘YOUR TRIP CODE” with your trip code. Each trip will have a unique id behind it but will have the same code that you enter here.

After adding the filter code:

Note: This filter code can only be used with WP Travel free plugin.

If you WP Travel Pro user then you can change the trip code manually, through the admin dashboard by going through Admin Panel > Trips > All Trips > Individual Trips > Trip Options > Itinerary > Trip code.

For more details, please refer to the attached knowledge Base.

Conclusion

Check WP Travel documentation to learn more about configurations, modules, payments, shortcodes, and the WP Travel Rest API.

Your feedback helps us improve. Please share your thoughts.

Need assistance? Contact our support team, join our Facebook community, and subscribe to our YouTube Channel for video tutorials.

You can also find us on Facebook, Instagram, LinkedIn, TikTok, and X. Thank you for choosing WP Travel.

If you are a WP Travel Free user thinking about upgrading to Pro, simply click on the banner below.

Get WP Travel Pro