manage_taxonomies_for_attachment_columns
Filter HookDescription
Filters the taxonomy columns for attachments in the Media list table.Hook Information
File Location |
wp-admin/includes/class-wp-media-list-table.php
View on GitHub
|
Hook Type | Filter |
Line Number | 351 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$taxonomies
|
An array of registered taxonomy names to show for attachments. |
string
|
$post_type
|
The post type. Default 'attachment'. |
Usage Examples
Basic Usage
<?php
// Hook into manage_taxonomies_for_attachment_columns
add_filter('manage_taxonomies_for_attachment_columns', 'my_custom_filter', 10, 2);
function my_custom_filter($taxonomies, $post_type) {
// Your custom filtering logic here
return $taxonomies;
}
Source Code Context
wp-admin/includes/class-wp-media-list-table.php:351
- How this hook is used in WordPress core
<?php
346 * @since 3.5.0
347 *
348 * @param string[] $taxonomies An array of registered taxonomy names to show for attachments.
349 * @param string $post_type The post type. Default 'attachment'.
350 */
351 $taxonomies = apply_filters( 'manage_taxonomies_for_attachment_columns', $taxonomies, 'attachment' );
352 $taxonomies = array_filter( $taxonomies, 'taxonomy_exists' );
353
354 foreach ( $taxonomies as $taxonomy ) {
355 if ( 'category' === $taxonomy ) {
356 $column_key = 'categories';
PHP Documentation
<?php
/**
* Filters the taxonomy columns for attachments in the Media list table.
*
* @since 3.5.0
*
* @param string[] $taxonomies An array of registered taxonomy names to show for attachments.
* @param string $post_type The post type. Default 'attachment'.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-admin/includes/class-wp-media-list-table.php
Related Hooks
Related hooks will be displayed here in future updates.