Advertisement
Guest User

Untitled

a guest
Feb 7th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. function claue_change_portfolio_slug() {
  2.     // get the arguments of the already-registered taxonomy
  3.     $portfolio_cat_args = get_taxonomy( 'portfolio_cat' ); // returns an object
  4.  
  5.     // make changes to the args
  6.     // in this example there are three changes
  7.     // again, note that it's an object
  8.     $portfolio_cat_args->show_admin_column = true;
  9.     $portfolio_cat_args->rewrite['slug'] = 'your_new_portfolio_slug_here';
  10.     $portfolio_cat_args->rewrite['with_front'] = false;
  11.  
  12.     // re-register the taxonomy
  13.     register_taxonomy( 'portfolio_cat', 'your_new_portfolio_slug_here', (array) $portfolio_cat_args );
  14. }
  15. // hook it up to 11 so that it overrides the original register_taxonomy function
  16. add_action( 'init', 'claue_change_portfolio_slug', 11 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement