Accessibility: Remove post format filter links from format icons in the Posts list table.

Introduce a dedicated 'Formats' drop-down filter as a replacement.

Keep the icons as a simple visual indicator of the post format for now.

Props afercia, melchoyce, GaryJ, chiaralovelaces, SergeyBiryukov.
Fixes #35497.
Built from https://develop.svn.wordpress.org/trunk@44961


git-svn-id: http://core.svn.wordpress.org/trunk@44792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2019-03-21 15:32:01 +00:00
parent 2aa1b8ff48
commit 99b929cbbc
11 changed files with 123 additions and 159 deletions

View File

@@ -13,18 +13,22 @@
* @return string Returns the block content.
*/
function render_block_core_calendar( $attributes ) {
global $monthnum, $year, $post;
global $monthnum, $year;
$previous_monthnum = $monthnum;
$previous_year = $year;
if ( isset( $attributes['month'] ) ) {
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
$monthnum = $attributes['month'];
}
if ( isset( $attributes['year'] ) ) {
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
$year = $attributes['year'];
if ( isset( $attributes['month'] ) && isset( $attributes['year'] ) ) {
$permalink_structure = get_option( 'permalink_structure' );
if (
strpos( $permalink_structure, '%monthnum%' ) !== false &&
strpos( $permalink_structure, '%year%' ) !== false
) {
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
$monthnum = $attributes['month'];
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
$year = $attributes['year'];
}
}
$custom_class_name = empty( $attributes['className'] ) ? '' : ' ' . $attributes['className'];