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

do_action('wp_create_file_in_uploads') is found 7 times:

  • /wp-admin/includes/ajax-actions.php line 4043
    				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
    			 */
    			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
    		$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
    			 *
    			 * @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
    				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
    			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
    			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 ) {