2727 | | // Don't print empty markup if there's only one page. |
2728 | | if ( $GLOBALS['wp_query']->max_num_pages > 1 ) { |
2729 | | // Make sure the nav element has an aria-label attribute: fallback to the screen reader text. |
2730 | | if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) { |
2731 | | $args['aria_label'] = $args['screen_reader_text']; |
2732 | | } |
| 2731 | // Make sure the nav element has an aria-label attribute, fallback to the screen reader text. |
| 2732 | if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) { |
| 2733 | $args['aria_label'] = $args['screen_reader_text']; |
| 2734 | } |
2734 | | $args = wp_parse_args( |
2735 | | $args, |
2736 | | array( |
2737 | | 'prev_text' => __( 'Older posts' ), |
2738 | | 'next_text' => __( 'Newer posts' ), |
2739 | | 'screen_reader_text' => __( 'Posts navigation' ), |
2740 | | 'aria_label' => __( 'Posts' ), |
2741 | | 'class' => 'posts-navigation', |
2742 | | ) |
2743 | | ); |
| 2736 | $args = wp_parse_args( |
| 2737 | $args, |
| 2738 | array( |
| 2739 | 'prev_text' => __( 'Older posts' ), |
| 2740 | 'next_text' => __( 'Newer posts' ), |
| 2741 | 'screen_reader_text' => __( 'Posts navigation' ), |
| 2742 | 'aria_label' => __( 'Posts' ), |
| 2743 | 'class' => 'posts-navigation', |
| 2744 | 'max_num_pages' => $wp_query->max_num_pages, |
| 2745 | ) |
| 2746 | ); |
2794 | | // Don't print empty markup if there's only one page. |
2795 | | if ( $GLOBALS['wp_query']->max_num_pages > 1 ) { |
2796 | | // Make sure the nav element has an aria-label attribute: fallback to the screen reader text. |
2797 | | if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) { |
2798 | | $args['aria_label'] = $args['screen_reader_text']; |
2799 | | } |
| 2803 | // Make sure the nav element has an aria-label attribute: fallback to the screen reader text. |
| 2804 | if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) { |
| 2805 | $args['aria_label'] = $args['screen_reader_text']; |
| 2806 | } |
2801 | | $args = wp_parse_args( |
2802 | | $args, |
2803 | | array( |
2804 | | 'mid_size' => 1, |
2805 | | 'prev_text' => _x( 'Previous', 'previous set of posts' ), |
2806 | | 'next_text' => _x( 'Next', 'next set of posts' ), |
2807 | | 'screen_reader_text' => __( 'Posts navigation' ), |
2808 | | 'aria_label' => __( 'Posts' ), |
2809 | | 'class' => 'pagination', |
2810 | | ) |
2811 | | ); |
| 2808 | $args = wp_parse_args( |
| 2809 | $args, |
| 2810 | array( |
| 2811 | 'mid_size' => 1, |
| 2812 | 'prev_text' => _x( 'Previous', 'previous set of posts' ), |
| 2813 | 'next_text' => _x( 'Next', 'next set of posts' ), |
| 2814 | 'screen_reader_text' => __( 'Posts navigation' ), |
| 2815 | 'aria_label' => __( 'Posts' ), |
| 2816 | 'class' => 'pagination', |
| 2817 | 'total' => $wp_query->max_num_pages, |
| 2818 | ) |
| 2819 | ); |