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. Built from https://develop.svn.wordpress.org/trunk@47374 git-svn-id: http://core.svn.wordpress.org/trunk@47161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
153eb7537e
commit
1a9b7f8737
|
@ -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 .= '
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.4-beta2-47373';
|
||||
$wp_version = '5.4-beta2-47374';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue