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.

Conclusion

If you liked this article, then subscribing to our YouTube Channel for WordPress video tutorials would be the cherry on top.

You can also find us on FacebookInstagram, Linkedin, TikTok, Pinterest, Reddit, and our dedicated engaging Facebook user community,

Further, if you have any queries, please submit them to our Contact page.

Get WP Travel Pro and start creating your travel and tour booking website within minutes without any hassle of coding.

create your travel site within minutes by wptravel.io ,buy wptravel pro