Skip to content

Instantly share code, notes, and snippets.

@ianpegg
Created January 11, 2024 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianpegg/bdb59dfd374665956d55c8c0dd9619b5 to your computer and use it in GitHub Desktop.
Save ianpegg/bdb59dfd374665956d55c8c0dd9619b5 to your computer and use it in GitHub Desktop.
Functions that allow the modification of built-in data types.
<?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