get_taxonomies_for_attachments( string $output = 'names' ): string[]|WP_Taxonomy[]

Retrieves all of the taxonomies that are registered for attachments.

Description

Handles mime-type-specific taxonomies such as attachment:image and attachment:video.

See also

Parameters

$outputstringoptional
The type of taxonomy output to return. Accepts 'names' or 'objects'.
Default 'names'.

Default:'names'

Return

string[]|WP_Taxonomy[] Array of names or objects of registered taxonomies for attachments.

Source

 * @since 5.8.0
 *
 * @param bool         $prev Optional. Whether to display the next (false) or previous (true) link. Default true.
 * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
 *                           of width and height values in pixels (in that order). Default 'thumbnail'.
 * @param bool         $text Optional. Link text. Default false.
 * @return string Markup for image link.
 */
function get_adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {
	$post        = get_post();
	$attachments = array_values(
		get_children(
			array(
				'post_parent'    => $post->post_parent,
				'post_status'    => 'inherit',
				'post_type'      => 'attachment',
				'post_mime_type' => 'image',
				'order'          => 'ASC',

Changelog

VersionDescription
3.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.