Ticket #35696: 35696.patch
File 35696.patch, 4.6 KB (added by , 9 years ago) |
---|
-
wp-includes/general-template.php
2944 2944 * @type string $add_fragment A string to append to each link. Default empty. 2945 2945 * @type string $before_page_number A string to appear before the page number. Default empty. 2946 2946 * @type string $after_page_number A string to append after the page number. Default empty. 2947 * @type array $classes { 2948 * Optional. An array of different classes. 2949 * 2950 * @type string $ul Class for the 'ul' tag. Default 'page-numbers'. 2951 * @type string $li Class for the 'li' tag. Default empty. 2952 * @type string $a Class for the 'a' tag. Default 'page-numbers'. 2953 * @type string $prev Class for the previous. Default 'prev'. 2954 * @type string $next Class for the next. Default 'next'. 2955 * @type string $current Class for the current. Default 'current'. 2956 * @type string $dots Class for the dots. Default 'dots'. 2957 * } 2947 2958 * } 2948 2959 * @return array|string|void String of page links or array of page links. 2949 2960 */ … … 2980 2991 'add_args' => array(), // array of query args to add 2981 2992 'add_fragment' => '', 2982 2993 'before_page_number' => '', 2983 'after_page_number' => '' 2994 'after_page_number' => '', 2995 'classes' => array( 2996 'ul' => 'page-numbers', 2997 'li' => '', 2998 'a' => 'page-numbers', 2999 'prev' => 'prev', 3000 'next' => 'next', 3001 'current' => 'current', 3002 'dots' => 'dots' 3003 ) 2984 3004 ); 2985 3005 2986 3006 $args = wp_parse_args( $args, $defaults ); … … 3040 3060 * 3041 3061 * @param string $link The paginated link URL. 3042 3062 */ 3043 $page_links[] = '<a class=" prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $args['prev_text'] . '</a>';3063 $page_links[] = '<a class="' . $args['classes']['a'] . ' ' . $args['classes']['prev'] . '" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $args['prev_text'] . '</a>'; 3044 3064 endif; 3045 3065 for ( $n = 1; $n <= $total; $n++ ) : 3046 3066 if ( $n == $current ) : 3047 $page_links[] = "<span class=' page-numbers current'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . "</span>";3067 $page_links[] = "<span class='" . $args['classes']['a'] . " " . $args['classes']['current'] . "'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . "</span>"; 3048 3068 $dots = true; 3049 3069 else : 3050 3070 if ( $args['show_all'] || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : … … 3055 3075 $link .= $args['add_fragment']; 3056 3076 3057 3077 /** This filter is documented in wp-includes/general-template.php */ 3058 $page_links[] = "<a class=' page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . "</a>";3078 $page_links[] = "<a class='" . $args['classes']['a'] . "' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . "</a>"; 3059 3079 $dots = true; 3060 3080 elseif ( $dots && ! $args['show_all'] ) : 3061 $page_links[] = '<span class=" page-numbers dots">' . __( '…' ) . '</span>';3081 $page_links[] = '<span class="' . $args['classes']['a'] . ' ' . $args['classes']['dots'] . '">' . __( '…' ) . '</span>'; 3062 3082 $dots = false; 3063 3083 endif; 3064 3084 endif; … … 3071 3091 $link .= $args['add_fragment']; 3072 3092 3073 3093 /** This filter is documented in wp-includes/general-template.php */ 3074 $page_links[] = '<a class=" next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $args['next_text'] . '</a>';3094 $page_links[] = '<a class="' . $args['classes']['a'] . ' ' . $args['classes']['next'] . '" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $args['next_text'] . '</a>'; 3075 3095 endif; 3076 3096 switch ( $args['type'] ) { 3077 3097 case 'array' : … … 3078 3098 return $page_links; 3079 3099 3080 3100 case 'list' : 3081 $r .= "<ul class=' page-numbers'>\n\t<li>";3082 $r .= join("</li>\n\t<li >", $page_links);3101 $r .= "<ul class='" . $args['classes']['ul'] . "'>\n\t<li class='" . $args['classes']['li'] . ">"; 3102 $r .= join("</li>\n\t<li class='" . $args['classes']['li'] . ">", $page_links); 3083 3103 $r .= "</li>\n</ul>\n"; 3084 3104 break; 3085 3105