In order to replace default /service/ slug in the Appointment Booking plugin add the following code to your child theme functions.php file:
function theme_edit_slug_mpa_service( $args, $post_type ) {
if ( 'mpa_service' === $post_type ) {
$args['rewrite']['slug'] = 'custom-service';
}
return $args;
}
add_filter( 'register_post_type_args', 'theme_edit_slug_mpa_service', 10, 2 );
Replace 'custom-service' with any desired slug.
After the code is added to the file, navigate to Settings > Permalinks in your dashboard and refresh them by updating settings without performing any changes there.
Navigate back to your website and check the service category slug - it should be changed now.
In order to replace default /service-category/ slug in Appointment Booking plugin add the following code to your child theme functions.php file:
function theme_edit_slug_mpa_service_category( $args, $taxonomy ) {
if ( 'mpa_service_category' === $taxonomy ) {
$args['rewrite']['slug'] = 'custom-service-category';
}
return $args;
}
add_filter( 'register_taxonomy_args', 'theme_edit_slug_mpa_service_category', 10, 2 );
Replace 'custom-service-category' with any desired slug.
After the code is added to the file, navigate to Settings > Permalinks in your dashboard and refresh them by updating settings without performing any changes there.
Navigate back to your website and check the service category slug - it should be changed now.
Comments
0 comments
Please sign in to leave a comment.