@@ -960,11 +960,11 @@ function wp_media_upload_handler() {
960960}
961961
962962/**
963- * Downloads an image from the specified URL and attaches it to a post.
963+ * Downloads an image from the specified URL, saves it as an attachment, and optionally attaches it to a post.
964964 *
965965 * @since 2.6.0
966966 * @since 4.2.0 Introduced the `$return` parameter.
967- * @since 4.8.0 Introduced the 'id' option within the `$return` parameter.
967+ * @since 4.8.0 Introduced the 'id' option for the `$return` parameter.
968968 * @since 5.3.0 The `$post_id` parameter was made optional.
969969 * @since 5.4.0 The original URL of the attachment is stored in the `_source_url`
970970 * post meta value.
@@ -974,7 +974,8 @@ function wp_media_upload_handler() {
974974 * @param string $desc Optional. Description of the image.
975975 * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL),
976976 * or 'id' (attachment ID). Default 'html'.
977- * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise.
977+ * @return string|int|WP_Error Populated HTML img tag, attachment ID, or attachment source
978+ * on success, WP_Error object otherwise.
978979 */
979980function media_sideload_image ( $ file , $ post_id = 0 , $ desc = null , $ return = 'html ' ) {
980981 if ( ! empty ( $ file ) ) {
@@ -2273,9 +2274,9 @@ function media_upload_form( $errors = null ) {
22732274 *
22742275 * @since 2.5.0
22752276 *
2276- * @param string $type
2277- * @param object $errors
2278- * @param int $id
2277+ * @param string $type
2278+ * @param object $errors
2279+ * @param int|WP_Error $id
22792280 */
22802281function media_upload_type_form ( $ type = 'file ' , $ errors = null , $ id = null ) {
22812282
0 commit comments