Ticket #45708: 45708.diff
| File 45708.diff, 4.7 KB (added by , 7 years ago) |
|---|
-
src/wp-includes/media.php
2755 2755 add_shortcode( 'video', 'wp_video_shortcode' ); 2756 2756 2757 2757 /** 2758 * Returns previous image link that has the same post parent. 2759 * 2760 * @since 5.1.0 2761 * 2762 * @see get_adjacent_image_link() 2763 * 2764 * @param string|array $size Optional. Image size. Accepts any valid image size, an array of width and 2765 * height values in pixels (in that order), 0, or 'none'. 0 or 'none' will 2766 * default to 'post_title' or `$text`. Default 'thumbnail'. 2767 * @param string $text Optional. Link text. Default false. 2768 * @return string Markup for previous image link. 2769 */ 2770 function get_previous_image_link( $size = 'thumbnail', $text = false ) { 2771 return get_adjacent_image_link( true, $size, $text ); 2772 } 2773 2774 /** 2758 2775 * Displays previous image link that has the same post parent. 2759 2776 * 2760 2777 * @since 2.5.0 2761 2778 * 2762 * @see adjacent_image_link()2763 *2764 2779 * @param string|array $size Optional. Image size. Accepts any valid image size, an array of width and 2765 2780 * height values in pixels (in that order), 0, or 'none'. 0 or 'none' will 2766 2781 * default to 'post_title' or `$text`. Default 'thumbnail'. … … 2771 2786 } 2772 2787 2773 2788 /** 2789 * Returns next image link that has the same post parent. 2790 * 2791 * @since 5.1.0 2792 * 2793 * @see get_adjacent_image_link() 2794 * 2795 * @param string|array $size Optional. Image size. Accepts any valid image size, an array of width and 2796 * height values in pixels (in that order), 0, or 'none'. 0 or 'none' will 2797 * default to 'post_title' or `$text`. Default 'thumbnail'. 2798 * @param string $text Optional. Link text. Default false. 2799 * @return string Markup for next image link. 2800 */ 2801 function get_next_image_link( $size = 'thumbnail', $text = false ) { 2802 return get_adjacent_image_link( false, $size, $text ); 2803 } 2804 2805 /** 2774 2806 * Displays next image link that has the same post parent. 2775 2807 * 2776 2808 * @since 2.5.0 2777 2809 * 2778 * @see adjacent_image_link()2779 *2780 2810 * @param string|array $size Optional. Image size. Accepts any valid image size, an array of width and 2781 2811 * height values in pixels (in that order), 0, or 'none'. 0 or 'none' will 2782 2812 * default to 'post_title' or `$text`. Default 'thumbnail'. … … 2783 2813 * @param string $text Optional. Link text. Default false. 2784 2814 */ 2785 2815 function next_image_link( $size = 'thumbnail', $text = false ) { 2786 adjacent_image_link( false,$size, $text );2816 echo get_next_image_link( $size, $text ); 2787 2817 } 2788 2818 2789 2819 /** 2790 * Displays next or previous image link that has the same post parent.2820 * Returns next or previous image link that has the same post parent. 2791 2821 * 2792 2822 * Retrieves the current attachment object from the $post global. 2793 2823 * 2794 * @since 2.5.02824 * @since 5.1.0 2795 2825 * 2796 2826 * @param bool $prev Optional. Whether to display the next (false) or previous (true) link. Default true. 2797 2827 * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width and height 2798 2828 * values in pixels (in that order). Default 'thumbnail'. 2799 2829 * @param bool $text Optional. Link text. Default false. 2830 * @return string Markup for image link. 2800 2831 */ 2801 function adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {2832 function get_adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) { 2802 2833 $post = get_post(); 2803 2834 $attachments = array_values( 2804 2835 get_children( … … 2846 2877 * @param string $size Image size. 2847 2878 * @param string $text Link text. 2848 2879 */ 2849 echoapply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );2880 return apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text ); 2850 2881 } 2851 2882 2852 2883 /** 2884 * Displays next or previous image link that has the same post parent. 2885 * 2886 * Retrieves the current attachment object from the $post global. 2887 * 2888 * @since 2.5.0 2889 * 2890 * @param bool $prev Optional. Whether to display the next (false) or previous (true) link. Default true. 2891 * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width and height 2892 * values in pixels (in that order). Default 'thumbnail'. 2893 * @param bool $text Optional. Link text. Default false. 2894 */ 2895 function adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) { 2896 echo get_adjacent_image_link( $prev, $size, $text ); 2897 } 2898 2899 /** 2853 2900 * Retrieves taxonomies attached to given the attachment. 2854 2901 * 2855 2902 * @since 2.5.0