From 4bbb7fb8521f80fcb2d55ccb6381a8a5bc58aaa0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 5 Jun 2020 08:30:10 +0000 Subject: [PATCH] Docs: Update the DocBlock for the `wp_media_attach_action` hook per the documentation standards. Rename the `$att_id` variable to `$attachment_id` for clarity. Follow-up to [47909]. See #49614. Built from https://develop.svn.wordpress.org/trunk@47913 git-svn-id: http://core.svn.wordpress.org/trunk@47687 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 26 +++++++++++++------------- wp-includes/version.php | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 35080275ed..8d0e4089dc 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -3683,7 +3683,7 @@ function wp_get_media_creation_timestamp( $metadata ) { } /** - * Encapsulate logic for Attach/Detach actions + * Encapsulates the logic for Attach/Detach actions. * * @since 4.2.0 * @@ -3706,14 +3706,14 @@ function wp_media_attach_action( $parent_id, $action = 'attach' ) { $ids = array(); - foreach ( (array) $_REQUEST['media'] as $att_id ) { - $att_id = (int) $att_id; + foreach ( (array) $_REQUEST['media'] as $attachment_id ) { + $attachment_id = (int) $attachment_id; - if ( ! current_user_can( 'edit_post', $att_id ) ) { + if ( ! current_user_can( 'edit_post', $attachment_id ) ) { continue; } - $ids[] = $att_id; + $ids[] = $attachment_id; } if ( ! empty( $ids ) ) { @@ -3727,19 +3727,19 @@ function wp_media_attach_action( $parent_id, $action = 'attach' ) { } if ( isset( $result ) ) { - foreach ( $ids as $att_id ) { + foreach ( $ids as $attachment_id ) { /** - * Fires when media is attached/detached from a post. + * Fires when media is attached or detached from a post. * - * @since 5.5 + * @since 5.5.0 * - * @param string $action Attach/detach action. - * @param int $att_id The attachment ID. - * @param int $parent_id Attachment parent ID. + * @param string $action Attach/detach action. Accepts 'attach' or 'detach'. + * @param int $attachment_id The attachment ID. + * @param int $parent_id Attachment parent ID. */ - do_action( 'wp_media_attach_action', $action, $att_id, $parent_id ); + do_action( 'wp_media_attach_action', $action, $attachment_id, $parent_id ); - clean_attachment_cache( $att_id ); + clean_attachment_cache( $attachment_id ); } $location = 'upload.php'; diff --git a/wp-includes/version.php b/wp-includes/version.php index 285ab037eb..a1e8749185 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47912'; +$wp_version = '5.5-alpha-47913'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.