mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-08 16:41:44 +01:00
Upgrade/Install: Make sure the "Show hidden updates" button is visible and works as expected.
The [https://api.jquery.com/toggle-event/ .toggle( handler, handler )] method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. This commit updates the click handler function to work with jQuery 1.9+. Follow-up to [9441], [9543], [42785], [48323]. Props malinevskiy, SergeyBiryukov. Fixes #54886. Built from https://develop.svn.wordpress.org/trunk@52644 git-svn-id: http://core.svn.wordpress.org/trunk@52233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2eaeae58ff
commit
66dc00211b
@ -206,18 +206,26 @@ function dismissed_updates() {
|
|||||||
'available' => false,
|
'available' => false,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if ( $dismissed ) {
|
|
||||||
|
|
||||||
|
if ( $dismissed ) {
|
||||||
$show_text = esc_js( __( 'Show hidden updates' ) );
|
$show_text = esc_js( __( 'Show hidden updates' ) );
|
||||||
$hide_text = esc_js( __( 'Hide hidden updates' ) );
|
$hide_text = esc_js( __( 'Hide hidden updates' ) );
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(function( $ ) {
|
jQuery( function( $ ) {
|
||||||
$( 'dismissed-updates' ).show();
|
$( '#show-dismissed' ).on( 'click', function() {
|
||||||
$( '#show-dismissed' ).toggle( function() { $( this ).text( '<?php echo $hide_text; ?>' ).attr( 'aria-expanded', 'true' ); }, function() { $( this ).text( '<?php echo $show_text; ?>' ).attr( 'aria-expanded', 'false' ); } );
|
var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) );
|
||||||
$( '#show-dismissed' ).click( function() { $( '#dismissed-updates' ).toggle( 'fast' ); } );
|
|
||||||
});
|
if ( isExpanded ) {
|
||||||
</script>
|
$( this ).text( '<?php echo $show_text; ?>' ).attr( 'aria-expanded', 'false' );
|
||||||
|
} else {
|
||||||
|
$( this ).text( '<?php echo $hide_text; ?>' ).attr( 'aria-expanded', 'true' );
|
||||||
|
}
|
||||||
|
|
||||||
|
$( '#dismissed-updates' ).toggle( 'fast' );
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<?php
|
<?php
|
||||||
echo '<p class="hide-if-no-js"><button type="button" class="button" id="show-dismissed" aria-expanded="false">' . __( 'Show hidden updates' ) . '</button></p>';
|
echo '<p class="hide-if-no-js"><button type="button" class="button" id="show-dismissed" aria-expanded="false">' . __( 'Show hidden updates' ) . '</button></p>';
|
||||||
echo '<ul id="dismissed-updates" class="core-updates dismissed">';
|
echo '<ul id="dismissed-updates" class="core-updates dismissed">';
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.0-alpha-52640';
|
$wp_version = '6.0-alpha-52644';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user