#62803 closed defect (bug) (fixed)
Fix update_attached_file return type comment
| Reported by: | arnoutblueshell | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.8 |
| Component: | Posts, Post Types | Version: | 6.9 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | Focuses: | docs, coding-standards |
Description
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 ) {
Attachments (1)
Change History (5)
#1
@
18 months ago
- Component General → Posts, Post Types
- Focuses docs added
- Milestone Awaiting Review → 6.8
- Owner set to
- Status new → reviewing
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch file with updated comments