Changeset 48378
- Timestamp:
- 07/07/2020 02:13:37 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r48197 r48378 2552 2552 * @since 4.4.0 Introduced the `in_same_term`, `excluded_terms`, and `taxonomy` arguments. 2553 2553 * @since 5.3.0 Added the `aria_label` parameter. 2554 * @since 5.5.0 Added the `class` parameter. 2554 2555 * 2555 2556 * @param array $args { … … 2563 2564 * @type string $screen_reader_text Screen reader text for the nav element. Default 'Post navigation'. 2564 2565 * @type string $aria_label ARIA label text for the nav element. Default 'Posts'. 2566 * @type string $class Custom class for the nav element. Default 'post-navigation'. 2565 2567 * } 2566 2568 * @return string Markup for post links. … … 2582 2584 'screen_reader_text' => __( 'Post navigation' ), 2583 2585 'aria_label' => __( 'Posts' ), 2586 'class' => 'post-navigation', 2584 2587 ) 2585 2588 ); … … 2605 2608 // Only add markup if there's somewhere to navigate to. 2606 2609 if ( $previous || $next ) { 2607 $navigation = _navigation_markup( $previous . $next, 'post-navigation', $args['screen_reader_text'], $args['aria_label'] );2610 $navigation = _navigation_markup( $previous . $next, $args['class'], $args['screen_reader_text'], $args['aria_label'] ); 2608 2611 } 2609 2612 … … 2628 2631 * @since 4.1.0 2629 2632 * @since 5.3.0 Added the `aria_label` parameter. 2633 * @since 5.5.0 Added the `class` parameter. 2630 2634 * 2631 2635 * @global WP_Query $wp_query WordPress Query object. … … 2641 2645 * Default 'Posts navigation'. 2642 2646 * @type string $aria_label ARIA label text for the nav element. Default 'Posts'. 2647 * @type string $class Custom class for the nav element. Default 'posts-navigation'. 2643 2648 * } 2644 2649 * @return string Markup for posts links. … … 2661 2666 'screen_reader_text' => __( 'Posts navigation' ), 2662 2667 'aria_label' => __( 'Posts' ), 2668 'class' => 'posts-navigation', 2663 2669 ) 2664 2670 ); … … 2675 2681 } 2676 2682 2677 $navigation = _navigation_markup( $navigation, 'posts-navigation', $args['screen_reader_text'], $args['aria_label'] );2683 $navigation = _navigation_markup( $navigation, $args['class'], $args['screen_reader_text'], $args['aria_label'] ); 2678 2684 } 2679 2685 … … 2698 2704 * @since 4.1.0 2699 2705 * @since 5.3.0 Added the `aria_label` parameter. 2706 * @since 5.5.0 Added the `class` parameter. 2700 2707 * 2701 2708 * @param array $args { … … 2705 2712 * Default 'Posts navigation'. 2706 2713 * @type string $aria_label ARIA label text for the nav element. Default 'Posts'. 2714 * @type string $class Custom class for the nav element. Default 'pagination'. 2707 2715 * } 2708 2716 * @return string Markup for pagination links. … … 2726 2734 'screen_reader_text' => __( 'Posts navigation' ), 2727 2735 'aria_label' => __( 'Posts' ), 2736 'class' => 'pagination', 2728 2737 ) 2729 2738 ); … … 2738 2747 2739 2748 if ( $links ) { 2740 $navigation = _navigation_markup( $links, 'pagination', $args['screen_reader_text'], $args['aria_label'] );2749 $navigation = _navigation_markup( $links, $args['class'], $args['screen_reader_text'], $args['aria_label'] ); 2741 2750 } 2742 2751 } … … 2765 2774 * 2766 2775 * @param string $links Navigational links. 2767 * @param string $class Optional. Custom class for the nav element. Default: 'posts-navigation'. 2768 * @param string $screen_reader_text Optional. Screen reader text for the nav element. Default: 'Posts navigation'. 2769 * @param string $aria_label Optional. ARIA label for the nav element. Default: same value as $screen_reader_text. 2776 * @param string $class Optional. Custom class for the nav element. 2777 * Default 'posts-navigation'. 2778 * @param string $screen_reader_text Optional. Screen reader text for the nav element. 2779 * Default 'Posts navigation'. 2780 * @param string $aria_label Optional. ARIA label for the nav element. 2781 * Defaults to the value of `$screen_reader_text`. 2770 2782 * @return string Navigation template tag. 2771 2783 */ … … 3017 3029 * @since 4.4.0 3018 3030 * @since 5.3.0 Added the `aria_label` parameter. 3031 * @since 5.5.0 Added the `class` parameter. 3019 3032 * 3020 3033 * @param array $args { … … 3027 3040 * @type string $screen_reader_text Screen reader text for the nav element. Default 'Comments navigation'. 3028 3041 * @type string $aria_label ARIA label text for the nav element. Default 'Comments'. 3042 * @type string $class Custom class for the nav element. Default 'comment-navigation'. 3029 3043 * } 3030 3044 * @return string Markup for comments links. … … 3047 3061 'screen_reader_text' => __( 'Comments navigation' ), 3048 3062 'aria_label' => __( 'Comments' ), 3063 'class' => 'comment-navigation', 3049 3064 ) 3050 3065 ); … … 3061 3076 } 3062 3077 3063 $navigation = _navigation_markup( $navigation, 'comment-navigation', $args['screen_reader_text'], $args['aria_label'] );3078 $navigation = _navigation_markup( $navigation, $args['class'], $args['screen_reader_text'], $args['aria_label'] ); 3064 3079 } 3065 3080 … … 3083 3098 * @since 4.4.0 3084 3099 * @since 5.3.0 Added the `aria_label` parameter. 3100 * @since 5.5.0 Added the `class` parameter. 3085 3101 * 3086 3102 * @see paginate_comments_links() … … 3091 3107 * @type string $screen_reader_text Screen reader text for the nav element. Default 'Comments navigation'. 3092 3108 * @type string $aria_label ARIA label text for the nav element. Default 'Comments'. 3109 * @type string $class Custom class for the nav element. Default 'comments-pagination'. 3093 3110 * } 3094 3111 * @return string Markup for pagination links. … … 3107 3124 'screen_reader_text' => __( 'Comments navigation' ), 3108 3125 'aria_label' => __( 'Comments' ), 3126 'class' => 'comments-pagination', 3109 3127 ) 3110 3128 ); … … 3119 3137 3120 3138 if ( $links ) { 3121 $navigation = _navigation_markup( $links, 'comments-pagination', $args['screen_reader_text'], $args['aria_label'] );3139 $navigation = _navigation_markup( $links, $args['class'], $args['screen_reader_text'], $args['aria_label'] ); 3122 3140 } 3123 3141
Note: See TracChangeset
for help on using the changeset viewer.