WordPress.org

Make WordPress Core

Ticket #32618: 32618.2.diff

File 32618.2.diff, 2.6 KB (added by DrewAPicture, 6 years ago)

Docs fixes + spacing

  • src/wp-includes/link-template.php

     
    23372337 * Return navigation to next/previous post when applicable.
    23382338 *
    23392339 * @since 4.1.0
     2340 * @since 4.4.0 Introduced the `in_same_term`, `excluded_terms`, and `taxonomy` arguments.
    23402341 *
    23412342 * @param array $args {
    23422343 *     Optional. Default post navigation arguments. Default empty array.
    23432344 *
    2344  *     @type string $prev_text          Anchor text to display in the previous post link. Default `%title`.
    2345  *     @type string $next_text          Anchor text to display in the next post link. Default `%title`.
    2346  *     @type string $screen_reader_text Screen reader text for nav element. Default 'Post navigation'.
     2345 *     @type string       $prev_text          Anchor text to display in the previous post link. Default '%title'.
     2346 *     @type string       $next_text          Anchor text to display in the next post link. Default '%title'.
     2347 *     @type bool         $in_same_term       Whether link should be in a same taxonomy term. Default false.
     2348 *     @type array|string $excluded_terms     Array or comma-separated list of excluded term IDs. Default empty.
     2349 *     @type string       $taxonomy           Taxonomy, if `$in_same_term` is true. Default 'category'.
     2350 *     @type string       $screen_reader_text Screen reader text for nav element. Default 'Post navigation'.
    23472351 * }
    23482352 * @return string Markup for post links.
    23492353 */
     
    23512355        $args = wp_parse_args( $args, array(
    23522356                'prev_text'          => '%title',
    23532357                'next_text'          => '%title',
     2358                'in_same_term'       => false,
     2359                'excluded_terms'     => '',
     2360                'taxonomy'           => 'category',
    23542361                'screen_reader_text' => __( 'Post navigation' ),
    23552362        ) );
    23562363
    23572364        $navigation = '';
    2358         $previous   = get_previous_post_link( '<div class="nav-previous">%link</div>', $args['prev_text'] );
    2359         $next       = get_next_post_link( '<div class="nav-next">%link</div>', $args['next_text'] );
    23602365
     2366        $previous = get_previous_post_link(
     2367                '<div class="nav-previous">%link</div>',
     2368                $args['prev_text'],
     2369                $args['in_same_term'],
     2370                $args['excluded_terms'],
     2371                $args['taxonomy']
     2372        );
     2373
     2374        $next = get_next_post_link(
     2375                '<div class="nav-next">%link</div>',
     2376                $args['next_text'],
     2377                $args['in_same_term'],
     2378                $args['excluded_terms'],
     2379                $args['taxonomy']
     2380        );
     2381
    23612382        // Only add markup if there's somewhere to navigate to.
    23622383        if ( $previous || $next ) {
    23632384                $navigation = _navigation_markup( $previous . $next, 'post-navigation', $args['screen_reader_text'] );