General: Introduce HTML classes in get_calendar()
for easier CSS targeting:
* `.wp-calendar-table` for the `<table>` element. * `.wp-calendar-nav` for the navigation wrapper. * `.wp-calendar-nav-prev` for the previous month link. * `.wp-calendar-nav-next` for the next month link. Replace `#prev` and `#next` HTML IDs with `.wp-calendar-nav-prev` and `.wp-calendar-nav-next` classes. Props sabernhardt, BackuPs, audrasjb, jorbin. Fixes #39763. git-svn-id: https://develop.svn.wordpress.org/trunk@47374 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
91878831dd
commit
22c02a0325
@ -2143,7 +2143,7 @@ function get_calendar( $initial = true, $echo = true ) {
|
||||
|
||||
/* translators: Calendar caption: 1: Month name, 2: 4-digit year. */
|
||||
$calendar_caption = _x( '%1$s %2$s', 'calendar caption' );
|
||||
$calendar_output = '<table id="wp-calendar">
|
||||
$calendar_output = '<table id="wp-calendar" class="wp-calendar-table">
|
||||
<caption>' . sprintf(
|
||||
$calendar_caption,
|
||||
$wp_locale->get_month( $thismonth ),
|
||||
@ -2238,24 +2238,24 @@ function get_calendar( $initial = true, $echo = true ) {
|
||||
|
||||
$calendar_output .= "\n\t</table>";
|
||||
|
||||
$calendar_output .= '<nav aria-label="' . __( 'Previous and next months' ) . '">';
|
||||
$calendar_output .= '<nav aria-label="' . __( 'Previous and next months' ) . '" class="wp-calendar-nav">';
|
||||
|
||||
if ( $previous ) {
|
||||
$calendar_output .= "\n\t\t" . '<span id="prev"><a href="' . get_month_link( $previous->year, $previous->month ) . '">« ' .
|
||||
$calendar_output .= "\n\t\t" . '<span class="wp-calendar-nav-prev"><a href="' . get_month_link( $previous->year, $previous->month ) . '">« ' .
|
||||
$wp_locale->get_month_abbrev( $wp_locale->get_month( $previous->month ) ) .
|
||||
'</a></span>';
|
||||
} else {
|
||||
$calendar_output .= "\n\t\t" . '<span id="prev"> </span>';
|
||||
$calendar_output .= "\n\t\t" . '<span class="wp-calendar-nav-prev"> </span>';
|
||||
}
|
||||
|
||||
$calendar_output .= "\n\t\t" . '<span class="pad"> </span>';
|
||||
|
||||
if ( $next ) {
|
||||
$calendar_output .= "\n\t\t" . '<span id="next"><a href="' . get_month_link( $next->year, $next->month ) . '">' .
|
||||
$calendar_output .= "\n\t\t" . '<span class="wp-calendar-nav-next"><a href="' . get_month_link( $next->year, $next->month ) . '">' .
|
||||
$wp_locale->get_month_abbrev( $wp_locale->get_month( $next->month ) ) .
|
||||
' »</a></span>';
|
||||
} else {
|
||||
$calendar_output .= "\n\t\t" . '<span id="next" class="pad"> </span>';
|
||||
$calendar_output .= "\n\t\t" . '<span class="wp-calendar-nav-next"> </span>';
|
||||
}
|
||||
|
||||
$calendar_output .= '
|
||||
|
Loading…
Reference in New Issue
Block a user