Skip to content

Commit

Permalink
Docs: Correct @return value for update_attached_file().
Browse files Browse the repository at this point in the history
Follow-up to [4612], [21967], [24490], [47611], [48214].

Props arnoutblueshell, karthickmurugan, SergeyBiryukov.
Fixes #62803.

git-svn-id: https://develop.svn.wordpress.org/trunk@59602 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jan 13, 2025
1 parent 062df4c commit 9d9d73c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -852,13 +852,15 @@ function get_attached_file( $attachment_id, $unfiltered = false ) {
* Updates attachment file path based on attachment ID.
*
* Used to update the file path of the attachment, which uses post meta name
* '_wp_attached_file' to store the path of the attachment.
* `_wp_attached_file` to store the path of the attachment.
*
* @since 2.1.0
*
* @param int $attachment_id Attachment ID.
* @param string $file File path for the attachment.
* @return bool True on success, false on failure.
* @return int|bool Meta ID if the `_wp_attached_file` key didn't exist for the attachment.
* True on successful update, false on failure or if the `$file` value passed
* to the function is the same as the one that is already in the database.
*/
function update_attached_file( $attachment_id, $file ) {
if ( ! get_post( $attachment_id ) ) {
Expand Down

0 comments on commit 9d9d73c

Please sign in to comment.