Created
September 2, 2022 06:12
-
-
Save etherealite/62cc233c86a61c92cb767bf557ebdc45 to your computer and use it in GitHub Desktop.
Remove rewrite front from event post type archives
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: VMA Internal Plugin | |
* Description: General purpose plugin for site specific integrations. | |
* Author: Evan Bangham | |
* Version: 0.0.1 | |
* Author URI: https://github.com/etherealite | |
* | |
* Text Domain: VMA | |
**/ | |
class Vma_Internal { | |
public static function bootstrap(): void | |
{ | |
$instance = new static(); | |
$instance->register(); | |
} | |
public function register(): void | |
{ | |
add_filter( | |
'register_taxonomy_event_listing_category_args', | |
[$this, 'filter_register_taxonomy_event_listing_category_args'], | |
10, | |
1 | |
); | |
add_filter( | |
'register_taxonomy_event_listing_type_args', | |
[$this, 'filter_register_taxonomy_event_listing_type_args'], | |
10, | |
1 | |
); | |
} | |
public function filter_register_taxonomy_event_listing_category_args( | |
array $args | |
): array | |
{ | |
$rewrite = [ | |
'with_front' => false, | |
'hierarchical' => false | |
]; | |
$args['rewrite'] = $rewrite; | |
return $args; | |
} | |
public function filter_register_taxonomy_event_listing_type_args( | |
array $args | |
): array | |
{ | |
$rewrite = [ | |
'with_front' => false, | |
'hierarchical' => false | |
]; | |
$args['rewrite'] = $rewrite; | |
return $args; | |
} | |
} | |
Vma_Internal::bootstrap(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment