get_attachment_taxonomies( int|array|object $attachment, string $output = 'names' ): string[]|WP_Taxonomy[]

In this article

Retrieves taxonomies attached to given the attachment.

Parameters

$attachmentint|array|objectrequired
Attachment ID, data array, or data object.
$outputstringoptional
Output type. 'names' to return an array of taxonomy names, or 'objects' to return an array of taxonomy objects.
Default is 'names'.

Default:'names'

Return

string[]|WP_Taxonomy[] List of taxonomies or taxonomy names. Empty array on failure.

Source

 * Gets the previous image link that has the same post parent.
 *
 * @since 5.8.0
 *
 * @see get_adjacent_image_link()
 *
 * @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 string|false $text Optional. Link text. Default false.
 * @return string Markup for previous image link.
 */
function get_previous_image_link( $size = 'thumbnail', $text = false ) {
	return get_adjacent_image_link( true, $size, $text );
}

/**
 * Displays previous image link that has the same post parent.
 *
 * @since 2.5.0
 *
 * @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 string|false $text Optional. Link text. Default false.
 */
function previous_image_link( $size = 'thumbnail', $text = false ) {
	echo get_previous_image_link( $size, $text );
}

/**
 * Gets the next image link that has the same post parent.
 *
 * @since 5.8.0
 *
 * @see get_adjacent_image_link()
 *
 * @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 string|false $text Optional. Link text. Default false.
 * @return string Markup for next image link.
 */
function get_next_image_link( $size = 'thumbnail', $text = false ) {
	return get_adjacent_image_link( false, $size, $text );
}

/**
 * Displays next image link that has the same post parent.
 *
 * @since 2.5.0

Changelog

VersionDescription
4.7.0Introduced the $output parameter.
2.5.0Introduced.

User Contributed Notes

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