wp_create_file_in_uploads

wp_create_file_in_uploads

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

do_action('wp_create_file_in_uploads') is found 7 times:

  • /wp-admin/includes/ajax-actions.php line 4043
    4039
    4040
    4041
    4042
    4043
    4044
    4045
    4046
    4047
    4048
    4049
        break;
    }
     
    /** This filter is documented in wp-admin/includes/class-custom-image-header.php */
    $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
     
    // Copy attachment properties.
    $attachment = wp_copy_parent_attachment_properties( $cropped, $attachment_id, $context );
     
    // Update the attachment.
    add_filter( 'intermediate_image_sizes_advanced', array( $wp_site_icon, 'additional_sizes' ) );
  • /wp-admin/includes/ajax-actions.php line 4072
    4068
    4069
    4070
    4071
    4072
    4073
    4074
    4075
    4076
    4077
    4078
    */
    do_action( 'wp_ajax_crop_image_pre_save', $context, $attachment_id, $cropped );
     
    /** This filter is documented in wp-admin/includes/class-custom-image-header.php */
    $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
     
    // Copy attachment properties.
    $attachment = wp_copy_parent_attachment_properties( $cropped, $attachment_id, $context );
     
    $attachment_id = wp_insert_attachment( $attachment, $cropped );
    $metadata      = wp_generate_attachment_metadata( $attachment_id, $cropped );
  • /wp-admin/includes/class-custom-background.php line 578
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
        $thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
        set_theme_mod( 'background_image_thumb', sanitize_url( $thumbnail[0] ) );
     
        /** This filter is documented in wp-admin/includes/class-custom-image-header.php */
        $file = apply_filters( 'wp_create_file_in_uploads', $file, $id ); // For replication.
     
        $this->updated = true;
    }
     
    /**
     * Handles Ajax request for adding custom background context to an attachment.
  • /wp-admin/includes/class-custom-image-header.php line 896
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
         *
         * @param string $file          Path to the file.
         * @param int    $attachment_id Attachment ID.
         */
        $file = apply_filters( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication.
     
        return $this->finished();
    } elseif ( $width > $max_width ) {
        $oitar = $width / $max_width;
     
        $image = wp_crop_image(
  • /wp-admin/includes/class-custom-image-header.php line 919
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
            wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
        }
     
        /** This filter is documented in wp-admin/includes/class-custom-image-header.php */
        $image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication.
     
        $url    = str_replace( wp_basename( $url ), wp_basename( $image ), $url );
        $width  = $width / $oitar;
        $height = $height / $oitar;
    } else {
        $oitar = 1;
  • /wp-admin/includes/class-custom-image-header.php line 1078
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
        wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
    }
     
    /** This filter is documented in wp-admin/includes/class-custom-image-header.php */
    $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
     
    $attachment = wp_copy_parent_attachment_properties( $cropped, $attachment_id, 'custom-header' );
     
    if ( ! empty( $_POST['create-new-attachment'] ) ) {
        unset( $attachment['ID'] );
    }
  • /wp-admin/includes/class-custom-image-header.php line 1424
    1420
    1421
    1422
    1423
    1424
    1425
    1426
    1427
    1428
    1429
    1430
        wp_send_json_error( array( 'message' => __( 'Image could not be processed. Please go back and try again.' ) ) );
    }
     
    /** This filter is documented in wp-admin/includes/class-custom-image-header.php */
    $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
     
    $attachment = wp_copy_parent_attachment_properties( $cropped, $attachment_id, 'custom-header' );
     
    $previous = $this->get_previous_crop( $attachment );
     
    if ( $previous ) {