I know that how to add add 'with_front' = false
for WordPress custom taxonomy when adding them.
But how to apply WordPress 'with_front' = false
for categories?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityThe register_taxonomy_args
filter should do the job intercepting the arguments for the specified taxonomy:
add_filter( 'register_taxonomy_args', 'cyb_modify_category_args', 99, 2 );
function cyb_modify_category_args( $args, $taxonomy ) {
if( 'category' === $taxonomy && is_array( $args ) ) {
$args['rewrite']['with_front'] = false;
}
return $args;
}
function( $args, $taxonomy )
to a filter. Please can you explain little more how this work? What is the meaning of function( $args, $taxonomy )
Jul 12, 2017 at 10:35