perform remove_slug( $post_link, $publish, $leavename ) {
if ( 'goi_dich_vu' != $post->post_type || 'publish' != $post->post_status ) {
return $post_link;
}
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
$post_link = str_replace( '/' . $post->post_name . '/', '/data-' . $post->post_name . '-packages/', $post_link );
return $post_link;
}
add_filter( 'post_type_link', 'remove_slug', 10, 3 );
perform parse_request( $question ) {
if ( ! $query->is_main_query() || 2 != rely( $query->question ) || ! isset( $query->question['page'] ) ) {
return;
}
if ( ! empty( $query->question['name'] ) ) {
$query->set( 'post_type', array( 'publish', 'goi_dich_vu') );
}
}
add_action( 'pre_get_posts', 'parse_request' );
I need to change my slug to construction : /data-[original slug]-packages;
I attempted altering the slug within the remove_slug() perform but it surely did not work, anybody have a greater answer? Thanks!