Finds and exports attachments associated with an email address.
Parameters
$email_address
stringrequired- The attachment owner email address.
$page
intoptional- Attachment page number.
Default:
1
Source
/**
* Filters the first-found post gallery.
*
* @since 3.6.0
*
* @param array $gallery The first-found post gallery.
* @param int|WP_Post $post Post ID or object.
* @param array $galleries Associative array of all found post galleries.
*/
return apply_filters( 'get_post_gallery', $gallery, $post, $galleries );
}
/**
* Retrieves the image srcs from galleries from a post's content, if present.
*
* @since 3.6.0
*
* @see get_post_galleries()
*
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
* @return array A list of lists, each containing image srcs parsed.
* from an expanded shortcode
*/
function get_post_galleries_images( $post = 0 ) {
$galleries = get_post_galleries( $post, false );
return wp_list_pluck( $galleries, 'src' );
}
/**
* Checks a post's content for galleries and return the image srcs for the first found gallery.
*
* @since 3.6.0
*
* @see get_post_gallery()
*
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
* @return string[] A list of a gallery's image srcs in order.
*/
function get_post_gallery_images( $post = 0 ) {
$gallery = get_post_gallery( $post, false );
return empty( $gallery['src'] ) ? array() : $gallery['src'];
}
/**
* Maybe attempts to generate attachment metadata, if missing.
*
* @since 3.9.0
*
* @param WP_Post $attachment Attachment object.
*/
function wp_maybe_generate_attachment_metadata( $attachment ) {
if ( empty( $attachment ) || empty( $attachment->ID ) ) {
return;
}
Changelog
Version | Description |
---|---|
4.9.6 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.