wp_generate_attachment_metadata

wp_generate_attachment_metadata

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('wp_generate_attachment_metadata') is found 2 times:

  • /wp-admin/includes/image.php line 185
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
            $image_meta = _wp_make_subsizes( $missing_sizes, $image_file, $image_meta, $attachment_id );
        }
     
        /** This filter is documented in wp-admin/includes/image.php */
        $image_meta = apply_filters( 'wp_generate_attachment_metadata', $image_meta, $attachment_id, 'update' );
     
        // Save the updated metadata.
        wp_update_attachment_metadata( $attachment_id, $image_meta );
     
        return $image_meta;
    }
  • /wp-admin/includes/image.php line 764
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
         * @param int    $attachment_id Current attachment ID.
         * @param string $context       Additional context. Can be 'create' when metadata was initially created for new attachment
         *                              or 'update' when the metadata was updated.
         */
        return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id, 'create' );
    }
     
    /**
     * Converts a fraction string to a decimal.
     *
     * @since 2.5.0

See this hook used in plugins: