[wp-trac] [WordPress Trac] #62803: Fix update_attached_file return type comment
WordPress Trac
noreply at wordpress.org
Mon Jan 13 10:02:42 UTC 2025
#62803: Fix update_attached_file return type comment
------------------------------+-----------------------------
Reporter: arnoutblueshell | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: minor | Keywords:
Focuses: coding-standards |
------------------------------+-----------------------------
The current return type comment of `update_attached_file` is inaccurate.
It only has the correct return type when the post meta is deleted. But
doesn't take into consideration when the post meta is updated.
Proposed new comment:
{{{
/**
* 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.
*
* @since 2.1.0
*
* @param int $attachment_id Attachment ID.
* @param string $file File path for the attachment.
* @return int|bool Meta ID if the key didn't exist, true on success,
* false on failure or if the value passed to the
function
* is the same as the one that is already in the
database.
*/
function update_attached_file( $attachment_id, $file ) {
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62803>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list