WordPress.org

Make WordPress Core

Ticket #45708: 45708.diff

File 45708.diff, 4.7 KB (added by flixos90, 10 months ago)
  • src/wp-includes/media.php

     
    27552755add_shortcode( 'video', 'wp_video_shortcode' );
    27562756
    27572757/**
     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 */
     2770function get_previous_image_link( $size = 'thumbnail', $text = false ) {
     2771        return get_adjacent_image_link( true, $size, $text );
     2772}
     2773
     2774/**
    27582775 * Displays previous image link that has the same post parent.
    27592776 *
    27602777 * @since 2.5.0
    27612778 *
    2762  * @see adjacent_image_link()
    2763  *
    27642779 * @param string|array $size Optional. Image size. Accepts any valid image size, an array of width and
    27652780 *                           height values in pixels (in that order), 0, or 'none'. 0 or 'none' will
    27662781 *                           default to 'post_title' or `$text`. Default 'thumbnail'.
     
    27712786}
    27722787
    27732788/**
     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 */
     2801function get_next_image_link( $size = 'thumbnail', $text = false ) {
     2802        return get_adjacent_image_link( false, $size, $text );
     2803}
     2804
     2805/**
    27742806 * Displays next image link that has the same post parent.
    27752807 *
    27762808 * @since 2.5.0
    27772809 *
    2778  * @see adjacent_image_link()
    2779  *
    27802810 * @param string|array $size Optional. Image size. Accepts any valid image size, an array of width and
    27812811 *                           height values in pixels (in that order), 0, or 'none'. 0 or 'none' will
    27822812 *                           default to 'post_title' or `$text`. Default 'thumbnail'.
     
    27832813 * @param string       $text Optional. Link text. Default false.
    27842814 */
    27852815function next_image_link( $size = 'thumbnail', $text = false ) {
    2786         adjacent_image_link( false, $size, $text );
     2816        echo get_next_image_link( $size, $text );
    27872817}
    27882818
    27892819/**
    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.
    27912821 *
    27922822 * Retrieves the current attachment object from the $post global.
    27932823 *
    2794  * @since 2.5.0
     2824 * @since 5.1.0
    27952825 *
    27962826 * @param bool         $prev Optional. Whether to display the next (false) or previous (true) link. Default true.
    27972827 * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width and height
    27982828 *                           values in pixels (in that order). Default 'thumbnail'.
    27992829 * @param bool         $text Optional. Link text. Default false.
     2830 * @return string Markup for image link.
    28002831 */
    2801 function adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {
     2832function get_adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {
    28022833        $post        = get_post();
    28032834        $attachments = array_values(
    28042835                get_children(
     
    28462877         * @param string $size          Image size.
    28472878         * @param string $text          Link text.
    28482879         */
    2849         echo apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );
     2880        return apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );
    28502881}
    28512882
    28522883/**
     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 */
     2895function adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {
     2896        echo get_adjacent_image_link( $prev, $size, $text );
     2897}
     2898
     2899/**
    28532900 * Retrieves taxonomies attached to given the attachment.
    28542901 *
    28552902 * @since 2.5.0