mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 12:14:25 +00:00
Site Health: Improve the "Copy to clipboard" button.
The previous method for copying the debug report to the clipboard involved having a hidden `<textarea>`, but this shows up in screen readers and can't be reliably hidden. To work around this, the button now uses the `clipboard.js` library, which automatically handles browser differences in the Clipboard API, and can load the text to copy from a `data-` attribute on the button. Props pento, hedgefield, afercia. Fixes #46647. git-svn-id: https://develop.svn.wordpress.org/trunk@45044 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -924,6 +924,8 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array( 'utils', 'jquery' ), false, 1 );
|
||||
|
||||
$scripts->add( 'clipboard', "/wp-includes/js/clipboard$suffix.js", array(), false, 1 );
|
||||
|
||||
// Back-compat for old DFW. To-do: remove at the end of 2016.
|
||||
$scripts->add( 'wp-fullscreen-stub', "/wp-admin/js/wp-fullscreen-stub$suffix.js", array(), false, 1 );
|
||||
|
||||
@@ -1688,7 +1690,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
)
|
||||
);
|
||||
|
||||
$scripts->add( 'site-health', "/wp-admin/js/site-health$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ), false, 1 );
|
||||
$scripts->add( 'site-health', "/wp-admin/js/site-health$suffix.js", array( 'clipboard', 'jquery', 'wp-util', 'wp-a11y' ), false, 1 );
|
||||
|
||||
$scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize(
|
||||
|
||||
Reference in New Issue
Block a user