Skip to content

Commit 6f41da3

Browse files
committed
Update readme and version numbers.
1 parent 1aaa58d commit 6f41da3

File tree

7 files changed

+37
-8
lines changed

7 files changed

+37
-8
lines changed

init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Domain Path: /lang
1818
* License: GPL-2.0+
1919
* License URI: http://www.gnu.org/license/gpl-2.0.txt
20-
* Version: 2.2.2
20+
* Version: 2.2.3
2121
*/
2222

2323
/*

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wp-accessibility",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"private": true,
55
"description": "WP Accessibility WordPress plug-in.",
66
"author": "Joe Dolson",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Improving the Accessibility of your WordPress site.
1111
* Requires at least: 5.9
1212
* Tested up to: 6.8
1313
* Requires PHP: 7.4
14-
* Stable tag: `2.2.2`
14+
* Stable tag: `2.2.3`
1515
* License: GPLv3
1616
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
1717

src/readme.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: accessibility, wcag, a11y, section508, alt text
55
Requires at least: 5.9
66
Tested up to: 6.8
77
Requires PHP: 7.4
8-
Stable tag: 2.2.2
8+
Stable tag: 2.2.3
99
Text Domain: wp-accessibility
1010
License: GPLv3
1111

@@ -82,6 +82,11 @@ WP Accessibility includes a statistics collection feature to help you identify h
8282

8383
[Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
8484

85+
= 2.2.3 =
86+
87+
* Change: Support and synchronize multiple toolbars on a single screen.
88+
* Feature: Option to switch the default File block behavior to 'link' instead of 'embed'.
89+
8590
= 2.2.2 =
8691

8792
* Bug fix: Rewrite in JS changed the data format sent to the server for stats.

src/wp-accessibility-settings.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@ function wpa_update_settings() {
101101
$wpa_search_alt = ( isset( $_POST['wpa_search_alt'] ) ) ? 'on' : '';
102102
$wpa_diagnostics = ( isset( $_POST['wpa_diagnostics'] ) ) ? 'on' : '';
103103
$wpa_disable_fullscreen = ( isset( $_POST['wpa_disable_fullscreen'] ) ) ? 'on' : '';
104+
$wpa_disable_file_embed = ( isset( $_POST['wpa_disable_file_embed'] ) ) ? 'on' : '';
104105
$wpa_allow_h1 = ( isset( $_POST['wpa_allow_h1'] ) ) ? 'on' : '';
105106
$wpa_disable_logout = ( isset( $_POST['wpa_disable_logout'] ) ) ? 'on' : '';
106107
$wpa_track_stats = ( isset( $_POST['wpa_track_stats'] ) ) ? sanitize_text_field( $_POST['wpa_track_stats'] ) : '';
107108
update_option( 'wpa_search_alt', $wpa_search_alt );
108109
update_option( 'wpa_diagnostics', $wpa_diagnostics );
109110
update_option( 'wpa_disable_fullscreen', $wpa_disable_fullscreen );
111+
update_option( 'wpa_disable_file_embed' , $wpa_disable_file_embed );
110112
update_option( 'wpa_allow_h1', $wpa_allow_h1 );
111113
update_option( 'wpa_track_stats', $wpa_track_stats );
112114
update_option( 'wpa_disable_logout', $wpa_disable_logout );
@@ -525,6 +527,10 @@ function wpa_admin_settings() {
525527
<input type="checkbox" id="wpa_disable_fullscreen" name="wpa_disable_fullscreen" <?php checked( get_option( 'wpa_disable_fullscreen' ), 'on' ); ?>/>
526528
<label for="wpa_disable_fullscreen"><?php _e( 'Disable fullscreen block editor by default', 'wp-accessibility' ); ?></label>
527529
</li>
530+
<li>
531+
<input type="checkbox" id="wpa_disable_file_embed" name="wpa_disable_file_embed" <?php checked( get_option( 'wpa_disable_file_embed' ), 'on' ); ?>/>
532+
<label for="wpa_disable_file_embed"><?php _e( 'Disable embed behavior as default on file block', 'wp-accessibility' ); ?></label>
533+
</li>
528534
<li>
529535
<input type="checkbox" id="wpa_allow_h1" name="wpa_allow_h1" <?php checked( get_option( 'wpa_allow_h1' ), 'on' ); ?>/>
530536
<label for="wpa_allow_h1"><?php _e( 'Allow <code>h1</code> in the headings block', 'wp-accessibility' ); ?></label>

src/wp-accessibility.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Domain Path: /lang
1818
* License: GPL-2.0+
1919
* License URI: http://www.gnu.org/license/gpl-2.0.txt
20-
* Version: 2.2.2
20+
* Version: 2.2.3
2121
*/
2222

2323
/*
@@ -50,7 +50,7 @@
5050
require_once __DIR__ . '/wp-accessibility-stats.php';
5151
}
5252

53-
define( 'WP_ACCESSIBILITY_VERSION', '2.2.2' );
53+
define( 'WP_ACCESSIBILITY_VERSION', '2.2.3' );
5454

5555
register_activation_hook( __FILE__, 'wpa_install' );
5656

@@ -853,6 +853,24 @@ function wpa_disable_editor_fullscreen_by_default() {
853853
}
854854
add_action( 'enqueue_block_editor_assets', 'wpa_disable_editor_fullscreen_by_default' );
855855

856+
/**
857+
* Disable file embeds by default.
858+
*
859+
* @param array $blockdata Array of block configuration meta data.
860+
*
861+
* @return array
862+
*/
863+
function wpa_disable_file_embed_by_default( $blockdata ) {
864+
if ( 'core/file' === $blockdata['name'] && 'on' === get_option( 'wpa_disable_file_embed' ) ) {
865+
if ( isset( $blockdata['attributes']['displayPreview'] ) ) {
866+
$blockdata['attributes']['displayPreview']['default'] = false;
867+
}
868+
}
869+
870+
return $blockdata;
871+
}
872+
add_filter( 'block_type_metadata', 'wpa_disable_file_embed_by_default' );
873+
856874
/**
857875
* Remove the H1 heading from the headings block.
858876
*

0 commit comments

Comments
 (0)