wp_get_original_image_path
Filters the path to the original image.
Использование
add_filter( 'wp_get_original_image_path', 'wp_kama_get_original_image_path_filter', 10, 2 ); /** * Function for `wp_get_original_image_path` filter-hook. * * @param string $original_image Path to original image file. * @param int $attachment_id Attachment ID. * * @return string */ function wp_kama_get_original_image_path_filter( $original_image, $attachment_id ){ // filter... return $original_image; }
- $original_image(строка)
- Path to original image file.
- $attachment_id(int)
- Attachment ID.
Список изменений
С версии 5.3.0 | Введена. |
Где вызывается хук
wp_get_original_image_path
wp-includes/post.php 8313
return apply_filters( 'wp_get_original_image_path', $original_image, $attachment_id );