Meta Boxes: reboot some of the code in postbox.js to support aria-expanded attribute toggling and to properly reference static class properties.

Props afercia, wonderboymusic.
Fixes #33754.


git-svn-id: https://develop.svn.wordpress.org/trunk@34893 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-10-07 01:57:06 +00:00
parent b7c01dc018
commit dae3ea83cb
4 changed files with 85 additions and 51 deletions

View File

@@ -989,8 +989,9 @@ function do_meta_boxes( $screen, $context, $object ) {
$hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
if ( 'dashboard_browser_nag' != $box['id'] ) {
echo '<button class="handlediv button-link" title="' . esc_attr__( 'Click to toggle' ) . '" aria-expanded="true">';
echo '<span class="screen-reader-text">' . sprintf( __( 'Click to toggle %s panel' ), $box['title'] ) . '</span><br />';
echo '<button type="button" class="handlediv button-link" aria-expanded="true">';
echo '<span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $box['title'] ) . '</span>';
echo '<span class="toggle-indicator" aria-hidden="true"></span>';
echo '</button>';
}
echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n";