Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to change taxonomy slug in wordpress

function space_change_custom_taxonomy_slug_args( $taxonomy, $object_type, $args ){
    if( 'old-slug' == $taxonomy ){ // Instead of the "old-slug", add current slug, which you want to change.
        remove_action( current_action(), __FUNCTION__ );
        $args['rewrite'] = array( 'slug' => 'new-slug' ); // Instead of the "new-slug", add a new slug name.
        register_taxonomy( $taxonomy, $object_type, $args );
    }
}
add_action( 'registered_taxonomy', 'space_change_custom_taxonomy_slug_args', 10, 3 );
Comment

PREVIOUS NEXT
Code Example
Php :: php laravel between dates 
Php :: automatically make created_by and updated_by laravel 
Php :: string to array in php 
Php :: carbon now 
Php :: laravel validation unique two columns 
Php :: Wordpress admin settings form 
Php :: array flat php 
Php :: php redirect seconds 
Php :: laravel handle queryexception 
Php :: Passing PHP Arrays to JavaScript 
Php :: get post php 
Php :: php check if entire array are in another array 
Php :: hide env file in laravel 
Php :: php get src content from image tag 
Php :: cakephp json response 
Php :: register sidebar wordpress 
Php :: php generating number 
Php :: woocommerce add to cart hook 
Php :: php convert string to chars 
Php :: php conditionally remove element from array 
Php :: how to get event dates on change in datetimepicker with laravel livewire 
Php :: get post by name wordpress 
Php :: php laravel config 
Php :: if browser url is having domain name in it check using php 
Php :: php read sql 
Php :: php array remove keys keep values 
Php :: get user information woocommerce 
Php :: check if the link is image or url php 
Php :: this page isn t working http error 500 laravel on server 
Php :: how to install symfony in windows 10 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =