get_attached_file хук-фильтр . WP 2.1.0
Filters the attached file based on the given ID.
Использование
add_filter( 'get_attached_file', 'filter_function_name_5538', 10, 2 ); function filter_function_name_5538( $file, $attachment_id ){ // filter... return $file; }
- $file(строка/false)
- The file path to where the attached file should be, false otherwise.
- $attachment_id(число)
- Attachment ID.
Список изменений
С версии 2.1.0 | Введена. |
Где вызывается хук
get_attached_file
wp-includes/post.php 521
return apply_filters( 'get_attached_file', $file, $attachment_id );