Title: wp-includes/post.php | Page 4 of 9 | Developer.WordPress.org

---

# File: wp-includes/post.php

 * function[wp_attachment_is_image()](https://developer.wordpress.org/reference/functions/wp_attachment_is_image/)
 * Determines whether an attachment is an image.
 * Used by [11 functions](https://developer.wordpress.org/reference/functions/wp_attachment_is_image/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_attachment_is_image/#uses)
   | Source: [wp-includes/post.php:7170](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7170-L7172)
 * hook[get_lastpostdate](https://developer.wordpress.org/reference/hooks/get_lastpostdate/)
 * Filters the most recent time that a post on the site was published.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/get_lastpostdate/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/get_lastpostdate/#uses)
   | Source: [wp-includes/post.php:7558](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7558-L7558)
 * function[wp_mime_type_icon()](https://developer.wordpress.org/reference/functions/wp_mime_type_icon/)
 * Retrieves the icon for a MIME type or attachment.
 * Used by [5 functions](https://developer.wordpress.org/reference/functions/wp_mime_type_icon/#used-by)
   | Uses [9 functions](https://developer.wordpress.org/reference/functions/wp_mime_type_icon/#uses)
   | Source: [wp-includes/post.php:7184](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7184-L7325)
 * function[get_lastpostmodified()](https://developer.wordpress.org/reference/functions/get_lastpostmodified/)
 * Gets the most recent time that a post on the site was modified.
 * Used by [2 functions](https://developer.wordpress.org/reference/functions/get_lastpostmodified/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/get_lastpostmodified/#uses)
   | Source: [wp-includes/post.php:7577](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7577-L7616)
 * hook[icon_dir](https://developer.wordpress.org/reference/hooks/icon_dir/)
 * Filters the icon directory path.
 * Used by [3 functions](https://developer.wordpress.org/reference/hooks/icon_dir/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/icon_dir/#uses)
   | Source: [wp-includes/post.php:7229](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7229-L7229)
 * hook[get_lastpostmodified](https://developer.wordpress.org/reference/hooks/get_lastpostmodified/)
 * Filters the most recent time that a post on the site was modified.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/get_lastpostmodified/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/get_lastpostmodified/#uses)
   | Source: [wp-includes/post.php:7615](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7615-L7615)
 * hook[icon_dir_uri](https://developer.wordpress.org/reference/hooks/icon_dir_uri/)
 * Filters the icon directory URI.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/icon_dir_uri/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/icon_dir_uri/#uses)
   | Source: [wp-includes/post.php:7238](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7238-L7238)
 * function[_get_last_post_time()](https://developer.wordpress.org/reference/functions/_get_last_post_time/)
 * Gets the timestamp of the last time any post was modified or published.
 * Used by [2 functions](https://developer.wordpress.org/reference/functions/_get_last_post_time/#used-by)
   | Uses [5 functions](https://developer.wordpress.org/reference/functions/_get_last_post_time/#uses)
   | Source: [wp-includes/post.php:7633](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7633-L7680)
 * hook[icon_dirs](https://developer.wordpress.org/reference/hooks/icon_dirs/)
 * Filters the array of icon directory URIs.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/icon_dirs/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/icon_dirs/#uses)
   | Source: [wp-includes/post.php:7247](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7247-L7247)
 * function[update_post_cache()](https://developer.wordpress.org/reference/functions/update_post_cache/)
 * Updates posts in cache.
 * Used by [4 functions](https://developer.wordpress.org/reference/functions/update_post_cache/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/update_post_cache/#uses)
   | Source: [wp-includes/post.php:7689](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7689-L7702)
 * hook[wp_mime_type_icon](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/)
 * Filters the mime type icon.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/#uses)
   | Source: [wp-includes/post.php:7324](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7324-L7324)
 * hook[wp_update_attachment_metadata](https://developer.wordpress.org/reference/hooks/wp_update_attachment_metadata/)
 * Filters the updated attachment meta data.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_update_attachment_metadata/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_update_attachment_metadata/#uses)
   | Source: [wp-includes/post.php:6952](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6952-L6952)
 * function[wp_get_attachment_url()](https://developer.wordpress.org/reference/functions/wp_get_attachment_url/)
 * Retrieves the URL for an attachment.
 * Used by [38 functions](https://developer.wordpress.org/reference/functions/wp_get_attachment_url/#used-by)
   | Uses [11 functions](https://developer.wordpress.org/reference/functions/wp_get_attachment_url/#uses)
   | Source: [wp-includes/post.php:6970](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6970-L7034)
 * hook[wp_get_attachment_url](https://developer.wordpress.org/reference/hooks/wp_get_attachment_url/)
 * Filters the attachment URL.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_get_attachment_url/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_get_attachment_url/#uses)
   | Source: [wp-includes/post.php:7027](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7027-L7027)
 * function[wp_insert_attachment()](https://developer.wordpress.org/reference/functions/wp_insert_attachment/)
 * Inserts an attachment.
 * Used by [14 functions](https://developer.wordpress.org/reference/functions/wp_insert_attachment/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/wp_insert_attachment/#uses)
   | Source: [wp-includes/post.php:6652](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6652-L6667)
 * function[wp_get_attachment_thumb_url()](https://developer.wordpress.org/reference/functions/wp_get_attachment_thumb_url/)
 * Retrieves URL for an attachment thumbnail.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_get_attachment_thumb_url/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/wp_get_attachment_thumb_url/#uses)
   | Source: [wp-includes/post.php:7078](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7078-L7100)
 * hook[wp_insert_attachment_data](https://developer.wordpress.org/reference/hooks/wp_insert_attachment_data/)
 * Filters attachment post data before it is updated in or added to the database.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_insert_attachment_data/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_insert_attachment_data/#uses)
   | Source: [wp-includes/post.php:4871](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L4871-L4871)
 * hook[wp_get_attachment_thumb_url](https://developer.wordpress.org/reference/hooks/wp_get_attachment_thumb_url/)
 * Filters the attachment thumbnail URL.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_get_attachment_thumb_url/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_get_attachment_thumb_url/#uses)
   | Source: [wp-includes/post.php:7099](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7099-L7099)
 * hook[edit_attachment](https://developer.wordpress.org/reference/hooks/edit_attachment/)
 * Fires once an existing attachment has been updated.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/edit_attachment/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/edit_attachment/#uses)
   | Source: [wp-includes/post.php:5094](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L5094-L5094)
 * function[wp_delete_attachment()](https://developer.wordpress.org/reference/functions/wp_delete_attachment/)
 * Trashes or deletes an attachment.
 * Used by [4 functions](https://developer.wordpress.org/reference/functions/wp_delete_attachment/#used-by)
   | Uses [22 functions](https://developer.wordpress.org/reference/functions/wp_delete_attachment/#uses)
   | Source: [wp-includes/post.php:6688](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6688-L6777)
 * hook[delete_attachment](https://developer.wordpress.org/reference/hooks/delete_attachment/)
 * Fires before an attachment is deleted, at the start of wp_delete_attachment().
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/delete_attachment/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/delete_attachment/#uses)
   | Source: [wp-includes/post.php:6741](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6741-L6741)
 * function[wp_get_attachment_metadata()](https://developer.wordpress.org/reference/functions/wp_get_attachment_metadata/)
 * Retrieves attachment metadata for attachment ID.
 * Used by [35 functions](https://developer.wordpress.org/reference/functions/wp_get_attachment_metadata/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/wp_get_attachment_metadata/#uses)
   | Source: [wp-includes/post.php:6890](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6890-L6922)
 * hook[wp_get_attachment_metadata](https://developer.wordpress.org/reference/hooks/wp_get_attachment_metadata/)
 * Filters the attachment meta data.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_get_attachment_metadata/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_get_attachment_metadata/#uses)
   | Source: [wp-includes/post.php:6921](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6921-L6921)
 * function[wp_update_attachment_metadata()](https://developer.wordpress.org/reference/functions/wp_update_attachment_metadata/)
 * Updates metadata for an attachment.
 * Used by [20 functions](https://developer.wordpress.org/reference/functions/wp_update_attachment_metadata/#used-by)
   | Uses [4 functions](https://developer.wordpress.org/reference/functions/wp_update_attachment_metadata/#uses)
   | Source: [wp-includes/post.php:6935](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6935-L6958)
 * function[get_to_ping()](https://developer.wordpress.org/reference/functions/get_to_ping/)
 * Retrieves URLs that need to be pinged.
 * Used by [2 functions](https://developer.wordpress.org/reference/functions/get_to_ping/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/get_to_ping/#uses)
   | Source: [wp-includes/post.php:6045](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6045-L6063)
 * hook[get_pages](https://developer.wordpress.org/reference/hooks/get_pages/)
 * Filters the retrieved list of pages.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/get_pages/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/get_pages/#uses)
   | Source: [wp-includes/post.php:6588](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6588-L6588)
 * hook[get_to_ping](https://developer.wordpress.org/reference/hooks/get_to_ping/)
 * Filters the list of URLs yet to ping for the given post.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/get_to_ping/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/get_to_ping/#uses)
   | Source: [wp-includes/post.php:6062](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6062-L6062)
 * function[is_local_attachment()](https://developer.wordpress.org/reference/functions/is_local_attachment/)
 * Determines whether an attachment URI is local and really an attachment.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/is_local_attachment/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/is_local_attachment/#uses)
   | Source: [wp-includes/post.php:6607](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6607-L6623)
 * function[trackback_url_list()](https://developer.wordpress.org/reference/functions/trackback_url_list/)
 * Does trackbacks for a list of URLs.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/trackback_url_list/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/trackback_url_list/#uses)
   | Source: [wp-includes/post.php:6073](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6073-L6091)
 * function[get_all_page_ids()](https://developer.wordpress.org/reference/functions/get_all_page_ids/)
 * Gets a list of page IDs.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/get_all_page_ids/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/get_all_page_ids/#uses)
   | Source: [wp-includes/post.php:6106](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L6106-L6116)

 [Previous Page](https://developer.wordpress.org/reference/files/wp-includes/post.php/page/3/?output_format=md)

[1](https://developer.wordpress.org/reference/files/wp-includes/post.php/?output_format=md)
[2](https://developer.wordpress.org/reference/files/wp-includes/post.php/page/2/?output_format=md)
[3](https://developer.wordpress.org/reference/files/wp-includes/post.php/page/3/?output_format=md)
4 [5](https://developer.wordpress.org/reference/files/wp-includes/post.php/page/5/?output_format=md)
[6](https://developer.wordpress.org/reference/files/wp-includes/post.php/page/6/?output_format=md)…
[9](https://developer.wordpress.org/reference/files/wp-includes/post.php/page/9/?output_format=md)

 [Next Page](https://developer.wordpress.org/reference/files/wp-includes/post.php/page/5/?output_format=md)