Last active
March 15, 2023 22:46
-
-
Save seanlanglands/aa7685668c259d30b86d5ec0c41c989e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* Overwrite default post_tag taxonomy to be non-public. | |
* | |
* @see https://developer.wordpress.org/reference/functions/register_taxonomy/ | |
* | |
* @return void | |
*/ | |
function vip_modify_post_tag_taxonomy() { | |
$post_tag_args = get_taxonomy( 'post_tag' ); | |
$post_tag_args->public = false; | |
$post_tag_args->publicly_queryable = false; | |
register_taxonomy( 'post_tag', 'post', $post_tag_args ); | |
} | |
add_action( 'init', 'vip_modify_post_tag_taxonomy', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment