WP_REST_Attachments_Controller::edit_media_item()
wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
|
Applies edits to a media item and creates a new attachment record.
|
wp_img_tag_add_width_and_height_attr()
wp-includes/media.php
|
Adds width and height attributes to an img HTML tag.
|
wp_img_tag_add_srcset_and_sizes_attr()
wp-includes/media.php
|
Adds srcset and sizes attributes to an existing img HTML tag.
|
wp_get_original_image_path()
wp-includes/post.php
|
Retrieves the path to an uploaded image file.
|
wp_get_original_image_url()
wp-includes/post.php
|
Retrieves the URL to an original attachment image.
|
wp_get_missing_image_subsizes()
wp-admin/includes/image.php
|
Compare the existing image sub-sizes (as saved in the attachment meta) to the currently registered image sub-sizes, and return the difference.
|
wp_update_image_subsizes()
wp-admin/includes/image.php
|
If any of the currently registered image sub-sizes are missing, create them and update the image meta data.
|
WP_Widget_Media_Image::render_media()
wp-includes/widgets/class-wp-widget-media-image.php
|
Render the media on the frontend.
|
WP_Customize_Manager::import_theme_starter_content()
wp-includes/class-wp-customize-manager.php
|
Imports theme starter content into the customized state.
|
WP_REST_Attachments_Controller::prepare_item_for_response()
wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
|
Prepares a single attachment output for response.
|
wp_get_attachment_image_srcset()
wp-includes/media.php
|
Retrieves the value for an image attachment’s ‘srcset’ attribute.
|
wp_get_attachment_image_sizes()
wp-includes/media.php
|
Retrieves the value for an image attachment’s ‘sizes’ attribute.
|
wp_calculate_image_sizes()
wp-includes/media.php
|
Creates a ‘sizes’ attribute value for an image.
|
wp_restore_image()
wp-admin/includes/image-edit.php
|
Restores the metadata for a given attachment.
|
wp_save_image()
wp-admin/includes/image-edit.php
|
Saves image to post, along with enqueued changes in $_REQUEST['history'] .
|
wp_image_editor()
wp-admin/includes/image-edit.php
|
Loads the WP image-editing interface.
|
edit_form_image_editor()
wp-admin/includes/media.php
|
Displays the image and editor in the post editor
|
attachment_submitbox_metadata()
wp-admin/includes/media.php
|
Displays non-editable attachment metadata in the publish meta box.
|
get_media_item()
wp-admin/includes/media.php
|
Retrieves HTML form for modifying the image attachment.
|
edit_post()
wp-admin/includes/post.php
|
Updates an existing post with values provided in $_POST .
|
wp_ajax_save_attachment()
wp-admin/includes/ajax-actions.php
|
Handles updating attachment attributes via AJAX.
|
attachment_id3_data_meta_box()
wp-admin/includes/meta-boxes.php
|
Displays fields for ID3 data.
|
Custom_Image_Header::step_2()
wp-admin/includes/class-custom-image-header.php
|
Displays second step of custom header image page.
|
get_uploaded_header_images()
wp-includes/theme.php
|
Gets the header images uploaded for the active theme.
|
prepend_attachment()
wp-includes/post-template.php
|
Wraps attachment in paragraph tag before content.
|
wp_maybe_generate_attachment_metadata()
wp-includes/media.php
|
Maybe attempts to generate attachment metadata, if missing.
|
wp_prepare_attachment_for_js()
wp-includes/media.php
|
Prepares an attachment post object for JS, where it is expected to be JSON-encoded and fit into an Attachment model.
|
gallery_shortcode()
wp-includes/media.php
|
Builds the Gallery shortcode output.
|
wp_playlist_shortcode()
wp-includes/media.php
|
Builds the Playlist shortcode output.
|
image_get_intermediate_size()
wp-includes/media.php
|
Retrieves the image’s intermediate size (resized) path, width, and height.
|
wp_get_attachment_image()
wp-includes/media.php
|
Gets an HTML img element representing an image attachment.
|
image_downsize()
wp-includes/media.php
|
Scales an image to fit a particular size (such as ‘thumb’ or ‘medium’).
|
wp_delete_attachment()
wp-includes/post.php
|
Trashes or deletes an attachment.
|
wp_get_attachment_thumb_file()
wp-includes/deprecated.php
|
Retrieves thumbnail for an attachment.
|
wp_xmlrpc_server::_prepare_media_item()
wp-includes/class-wp-xmlrpc-server.php
|
Prepares media item data for return in an XML-RPC object.
|
Example return value
Note that, since WordPress 6.0, return value includes filesize. This is for can be utilized so that image file size ca be retrieved without having to call php function filesize.
See Media: storing file size as part of metadata.
Example for video format:
NOTE that when calling wp_get_attachment_metadata(), the ARRAY index returned from ‘file’ is the file path relative to wp-content/uploads.
If you want to get url of domain to link up, you can use snippet below