Attachments (Media files) (category)

wp_get_original_image_path()

Gets the path of the original image (not its resized copy) by the specified attachment ID.

wp_get_original_image_url()

Gets the URL of the original image (not its resized copy) by the specified attachment ID.

get_attached_file()

Gets the absolute (server) path of the attachment (attached file) by the provided attachment ID.

get_attached_media()

Gets attachments (images, videos, audio) attached to a post. Retrieves data objects in the form of an array.

Images

wp_get_image_alttext()

Retrieves alternative text from XMP metadata in an image file.

image_resize_dimensions()

Calculates dimensions and coordinates to resize an image so that it fits within a given width and height.

file_is_displayable_image()

Checks if the file is an image (if it is suitable for display on the page). Conditional tag.

Rarely used

wp_get_avif_info()

Extracts metadata of the specified AVIF image. Such as: width, height, color depth and number of channels.

wp_getimagesize()

Gets the image dimensions and other related information.

wp_read_image_metadata()

Gathers an array of useful image metadata from the exif and iptc file metadata.

Upload/Download

wp_max_upload_size()

Gets the maximum file size (in bytes) that is allowed to be uploaded in WordPress.

wp_check_filetype_and_ext()

Checks if the specified file is allowed to be uploaded based on its actual MIME type.

Thumbnails

wp_get_registered_image_subsizes()

Gets the data (width, height, crop) of the currently registered image sizes.

Metadata (postmeta)

delete_post_meta_by_key()

Deletes all meta-fields (custom fields) of all posts by the specified meta-field key.

wp_maybe_generate_attachment_metadata()

Creates attachment metadata if it is missing; otherwise, does nothing.