Created
January 11, 2024 13:22
-
-
Save ianpegg/bdb59dfd374665956d55c8c0dd9619b5 to your computer and use it in GitHub Desktop.
Functions that allow the modification of built-in data types.
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: EggMUP: Modify Built-in Data Types | |
* Plugin URI: https://gist.github.com/ianpegg/ | |
* Description: Functions that allow the modification of built-in data types. | |
* Version: 1.0.0 | |
* Author: Ian Pegg | |
* Author URI: https://eggcupwebdesign.com | |
* php version 7.4.15 | |
* | |
* @category Must_Use_Plugin | |
* @package WordPress_Plugin | |
* @author Ian Pegg <hello@eggcupweb.com> | |
* @license GNU/GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
* @link https://eggcupwebdesign.com | |
*/ | |
namespace EggCup\MUP\ModifyBuiltInDataTypes; | |
if (!defined('ABSPATH')) { | |
exit; | |
} | |
/** | |
* This script registers following functions with WP action hooks/filters: | |
*/ | |
add_action('init', __NAMESPACE__ . '\\Modify_Builtin_taxonomies', 10); | |
/** | |
* Passes an array of modified configuration arguments | |
* to register_taxonomy, which will use these values to | |
* overwrite the default configuration. | |
* | |
* @todo Add an argument to the function that accepts the | |
* configuration array, before validating and passing on to | |
* register_taxonomy. | |
* | |
* @return void | |
*/ | |
function Modify_Builtin_taxonomies() { | |
$Arr_args = [ | |
'publicly_queryable' => false, | |
]; | |
register_taxonomy( | |
'category', | |
'', | |
$Arr_args | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment