get_categories_taxonomy
Filter HookDescription
Filters the taxonomy used to retrieve terms when calling get_categories().Hook Information
File Location |
wp-includes/category.php
View on GitHub
|
Hook Type | Filter |
Line Number | 38 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$taxonomy
|
Taxonomy to retrieve terms from. |
array
|
$args
|
An array of arguments. See get_terms(). |
Usage Examples
Basic Usage
<?php
// Hook into get_categories_taxonomy
add_filter('get_categories_taxonomy', 'my_custom_filter', 10, 2);
function my_custom_filter($taxonomy, $args) {
// Your custom filtering logic here
return $taxonomy;
}
Source Code Context
wp-includes/category.php:38
- How this hook is used in WordPress core
<?php
33 * @since 2.7.0
34 *
35 * @param string $taxonomy Taxonomy to retrieve terms from.
36 * @param array $args An array of arguments. See get_terms().
37 */
38 $args['taxonomy'] = apply_filters( 'get_categories_taxonomy', $args['taxonomy'], $args );
39
40 // Back compat.
41 if ( isset( $args['type'] ) && 'link' === $args['type'] ) {
42 _deprecated_argument(
43 __FUNCTION__,
PHP Documentation
<?php
/**
* Filters the taxonomy used to retrieve terms when calling get_categories().
*
* @since 2.7.0
*
* @param string $taxonomy Taxonomy to retrieve terms from.
* @param array $args An array of arguments. See get_terms().
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/category.php
Related Hooks
Related hooks will be displayed here in future updates.