Skip to content

Commit 9d9d73c

Browse files
Docs: Correct @return value for update_attached_file().
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
1 parent 062df4c commit 9d9d73c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/wp-includes/post.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,13 +852,15 @@ function get_attached_file( $attachment_id, $unfiltered = false ) {
852852
* Updates attachment file path based on attachment ID.
853853
*
854854
* Used to update the file path of the attachment, which uses post meta name
855-
* '_wp_attached_file' to store the path of the attachment.
855+
* `_wp_attached_file` to store the path of the attachment.
856856
*
857857
* @since 2.1.0
858858
*
859859
* @param int $attachment_id Attachment ID.
860860
* @param string $file File path for the attachment.
861-
* @return bool True on success, false on failure.
861+
* @return int|bool Meta ID if the `_wp_attached_file` key didn't exist for the attachment.
862+
* True on successful update, false on failure or if the `$file` value passed
863+
* to the function is the same as the one that is already in the database.
862864
*/
863865
function update_attached_file( $attachment_id, $file ) {
864866
if ( ! get_post( $attachment_id ) ) {

0 commit comments

Comments
 (0)