diff --git a/src/wp-admin/includes/deprecated.php b/src/wp-admin/includes/deprecated.php
index e65fe5a79c..e49d8acb10 100644
|
a
|
b
|
function options_permalink_add_js() {
|
| 1514 | 1514 | </script> |
| 1515 | 1515 | <?php |
| 1516 | 1516 | } |
| | 1517 | |
| | 1518 | |
| | 1519 | /** |
| | 1520 | * Retrieve thumbnail for an attachment. |
| | 1521 | * |
| | 1522 | * @since 2.1.0 |
| | 1523 | * @deprecated 5.2 Use wp_get_attachment_image_file( $attachment_id, $size = 'thumbnail' ) |
| | 1524 | * |
| | 1525 | * @param int $post_id Optional. Attachment ID. Default 0. |
| | 1526 | * @return string|false False on failure. Thumbnail file path on success. |
| | 1527 | */ |
| | 1528 | function wp_get_attachment_thumb_file( $post_id = 0 ) { |
| | 1529 | _deprecated_function( __FUNCTION__, '5.2' ); |
| | 1530 | |
| | 1531 | $file = wp_get_attachment_image_file( $post_id ); |
| | 1532 | |
| | 1533 | if ( $file ) { |
| | 1534 | /** |
| | 1535 | * Filters the attachment thumbnail file path. |
| | 1536 | * |
| | 1537 | * @since 2.1.0 |
| | 1538 | * @deprecated 5.2 Use filter wp_get_attachment_image_file( $file, $attachment_id, $size ) |
| | 1539 | * |
| | 1540 | * @param string $thumbfile File path to the attachment thumbnail. |
| | 1541 | * @param int $post_id Attachment ID. |
| | 1542 | */ |
| | 1543 | return apply_filters( 'wp_get_attachment_thumb_file', $file, $post->ID ); |
| | 1544 | } |
| | 1545 | return false; |
| | 1546 | } |
diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index ecac41b7a2..578e99713d 100644
|
a
|
b
|
function wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon
|
| 948 | 948 | /** |
| 949 | 949 | * Get the size path of an image attachment. |
| 950 | 950 | * |
| | 951 | * @since 5.2 |
| | 952 | * |
| 951 | 953 | * @param int $attachment_id Attachment ID. |
| 952 | | * @param string|array $size Optional. Image size to retrieve. Accepts any valid image size, or an array |
| 953 | | * of width and height values. Default 'thumbnail' |
| | 954 | * @param string|array $size Optional. Image size to retrieve. Accepts any valid image size, or an array |
| | 955 | * of width and height values. Default 'thumbnail' |
| 954 | 956 | * |
| 955 | 957 | * @return string|null Attachment path or null if no image is available. |
| 956 | 958 | */ |
| … |
… |
function wp_get_attachment_image_file( $attachment_id, $size = 'thumbnail' ) {
|
| 980 | 982 | |
| 981 | 983 | $path = $wp_upload_dir['basedir'] . '/' . trailingslashit( $file_path ) . $file_name; |
| 982 | 984 | |
| 983 | | return $path; |
| 984 | | |
| | 985 | /** |
| | 986 | * Filters the attachment image file path. |
| | 987 | * |
| | 988 | * @since 5.2 |
| | 989 | * |
| | 990 | * @param string $path File path to the image file. |
| | 991 | * @param int $attachment_id Attachment ID. |
| | 992 | * @param string $size Image size used to get the size. |
| | 993 | */ |
| | 994 | return apply_filters( 'wp_get_attachment_image_file', $path, $attachment_id, $size ); |
| 985 | 995 | } |
| 986 | 996 | |
| 987 | 997 | |
diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index 5250aaa294..27873153ce 100644
|
a
|
b
|
function wp_get_attachment_caption( $post_id = 0 ) {
|
| 5685 | 5685 | return apply_filters( 'wp_get_attachment_caption', $caption, $post->ID ); |
| 5686 | 5686 | } |
| 5687 | 5687 | |
| 5688 | | /** |
| 5689 | | * Retrieve thumbnail for an attachment. |
| 5690 | | * |
| 5691 | | * @since 2.1.0 |
| 5692 | | * @deprecated 5.2 Use wp_get_attachment_image_file( $attachment_id, $size = 'thumbnail' ) |
| 5693 | | * |
| 5694 | | * @param int $post_id Optional. Attachment ID. Default 0. |
| 5695 | | * @return string|false False on failure. Thumbnail file path on success. |
| 5696 | | */ |
| 5697 | | function wp_get_attachment_thumb_file( $post_id = 0 ) { |
| 5698 | | $post_id = (int) $post_id; |
| 5699 | | if ( ! $post = get_post( $post_id ) ) { |
| 5700 | | return false; |
| 5701 | | } |
| 5702 | | if ( ! is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) ) { |
| 5703 | | return false; |
| 5704 | | } |
| 5705 | | |
| 5706 | | $file = get_attached_file( $post->ID ); |
| 5707 | | |
| 5708 | | if ( ! empty( $imagedata['thumb'] ) && ( $thumbfile = str_replace( wp_basename( $file ), $imagedata['thumb'], $file ) ) && file_exists( $thumbfile ) ) { |
| 5709 | | /** |
| 5710 | | * Filters the attachment thumbnail file path. |
| 5711 | | * |
| 5712 | | * @since 2.1.0 |
| 5713 | | * |
| 5714 | | * @param string $thumbfile File path to the attachment thumbnail. |
| 5715 | | * @param int $post_id Attachment ID. |
| 5716 | | */ |
| 5717 | | return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID ); |
| 5718 | | } |
| 5719 | | return false; |
| 5720 | | } |
| 5721 | | |
| 5722 | 5688 | /** |
| 5723 | 5689 | * Retrieve URL for an attachment thumbnail. |
| 5724 | 5690 | * |