wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
get_taxonomies_for_attachments › WordPress Function
Seit3.5.0
Veraltetn/v
› get_taxonomies_for_attachments ( $output = 'names' )
Parameter: |
|
Siehe: | |
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Retrieves all of the taxonomies that are registered for attachments.
Handles mime-type-specific taxonomies such as attachment:image and attachment:video.Ähnliche Funktionen: get_taxonomies, get_the_attachment_link, wp_ajax_query_attachments, get_taxonomy_labels, is_local_attachment
Quellcode
function get_taxonomies_for_attachments( $output = 'names' ) { $taxonomies = array(); foreach ( get_taxonomies( array(), 'objects' ) as $taxonomy ) { foreach ( $taxonomy->object_type as $object_type ) { if ( 'attachment' === $object_type || str_starts_with( $object_type, 'attachment:' ) ) { if ( 'names' === $output ) { $taxonomies[] = $taxonomy->name; } else { $taxonomies[ $taxonomy->name ] = $taxonomy; } break; } } } return $taxonomies; }