wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
_wp_image_meta_replace_original is private and should not be used in themes or plugins directly.
_wp_image_meta_replace_original › WordPress Function
Desde5.3.0
Obsoleton/a
› _wp_image_meta_replace_original ( $saved_data, $original_file, $image_meta, $attachment_id )
| Acesso: |
|
| Parâmetros: (4) |
|
| Retorna: |
|
| Definido em: |
|
| Codex: | |
| Log de mudanças: |
|
Updates the attached file and image meta data when the original image was edited.
Funções relacionadas: wp_get_theme_data_template_parts, wp_image_editor, wp_image_matches_ratio, wp_read_image_metadata, wp_get_cookie_login
Fonte
function _wp_image_meta_replace_original( $saved_data, $original_file, $image_meta, $attachment_id ) {
$new_file = $saved_data['path'];
// Update the attached file meta.
update_attached_file( $attachment_id, $new_file );
// Width and height of the new image.
$image_meta['width'] = $saved_data['width'];
$image_meta['height'] = $saved_data['height'];
// Make the file path relative to the upload dir.
$image_meta['file'] = _wp_relative_upload_path( $new_file );
// Add image file size.
$image_meta['filesize'] = wp_filesize( $new_file );
// Store the original image file name in image_meta.
$image_meta['original_image'] = wp_basename( $original_file );
return $image_meta;
}