dismissed_updates

The timeline below displays how wordpress function dismissed_updates has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 9.1

/**
 * Display dismissed updates.
 *
 * @since 2.7.0
 */
function dismissed_updates()
{
    $dismissed = get_core_updates(array('dismissed' => true, 'available' => false));
    if ($dismissed) {
        $show_text = esc_js(__('Show hidden updates'));
        $hide_text = esc_js(__('Hide hidden updates'));
        ?>
		<script type="text/javascript">
			jQuery( function( $ ) {
				$( '#show-dismissed' ).on( 'click', function() {
					var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) );

					if ( isExpanded ) {
						$( 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 
        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">';
        foreach ((array) $dismissed as $update) {
            echo '<li>';
            list_core_update($update);
            echo '</li>';
        }
        echo '</ul>';
    }
}

WordPress Version: 5.3

/**
 * Display dismissed updates.
 *
 * @since 2.7.0
 */
function dismissed_updates()
{
    $dismissed = get_core_updates(array('dismissed' => true, 'available' => false));
    if ($dismissed) {
        $show_text = esc_js(__('Show hidden updates'));
        $hide_text = esc_js(__('Hide hidden updates'));
        ?>
	<script type="text/javascript">
		jQuery(function( $ ) {
			$( 'dismissed-updates' ).show();
			$( '#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' ); } );
			$( '#show-dismissed' ).click( function() { $( '#dismissed-updates' ).toggle( 'fast' ); } );
		});
	</script>
		<?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 '<ul id="dismissed-updates" class="core-updates dismissed">';
        foreach ((array) $dismissed as $update) {
            echo '<li>';
            list_core_update($update);
            echo '</li>';
        }
        echo '</ul>';
    }
}

WordPress Version: 5.1

/**
 * @since 2.7.0
 */
function dismissed_updates()
{
    $dismissed = get_core_updates(array('dismissed' => true, 'available' => false));
    if ($dismissed) {
        $show_text = esc_js(__('Show hidden updates'));
        $hide_text = esc_js(__('Hide hidden updates'));
        ?>
	<script type="text/javascript">
		jQuery(function( $ ) {
			$( 'dismissed-updates' ).show();
			$( '#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' ); } );
			$( '#show-dismissed' ).click( function() { $( '#dismissed-updates' ).toggle( 'fast' ); } );
		});
	</script>
		<?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 '<ul id="dismissed-updates" class="core-updates dismissed">';
        foreach ((array) $dismissed as $update) {
            echo '<li>';
            list_core_update($update);
            echo '</li>';
        }
        echo '</ul>';
    }
}

WordPress Version: 4.3

/**
 * @since 2.7.0
 */
function dismissed_updates()
{
    $dismissed = get_core_updates(array('dismissed' => true, 'available' => false));
    if ($dismissed) {
        $show_text = esc_js(__('Show hidden updates'));
        $hide_text = esc_js(__('Hide hidden updates'));
        ?>
	<script type="text/javascript">

		jQuery(function($) {
			$('dismissed-updates').show();
			$('#show-dismissed').toggle(function(){$(this).text('<?php 
        echo $hide_text;
        ?>');}, function() {$(this).text('<?php 
        echo $show_text;
        ?>')});
			$('#show-dismissed').click(function() { $('#dismissed-updates').toggle('slow');});
		});
	</script>
	<?php 
        echo '<p class="hide-if-no-js"><a id="show-dismissed" href="#">' . __('Show hidden updates') . '</a></p>';
        echo '<ul id="dismissed-updates" class="core-updates dismissed">';
        foreach ((array) $dismissed as $update) {
            echo '<li>';
            list_core_update($update);
            echo '</li>';
        }
        echo '</ul>';
    }
}

WordPress Version: 3.7

function dismissed_updates()
{
    $dismissed = get_core_updates(array('dismissed' => true, 'available' => false));
    if ($dismissed) {
        $show_text = esc_js(__('Show hidden updates'));
        $hide_text = esc_js(__('Hide hidden updates'));
        ?>
	<script type="text/javascript">

		jQuery(function($) {
			$('dismissed-updates').show();
			$('#show-dismissed').toggle(function(){$(this).text('<?php 
        echo $hide_text;
        ?>');}, function() {$(this).text('<?php 
        echo $show_text;
        ?>')});
			$('#show-dismissed').click(function() { $('#dismissed-updates').toggle('slow');});
		});
	</script>
	<?php 
        echo '<p class="hide-if-no-js"><a id="show-dismissed" href="#">' . __('Show hidden updates') . '</a></p>';
        echo '<ul id="dismissed-updates" class="core-updates dismissed">';
        foreach ((array) $dismissed as $update) {
            echo '<li>';
            list_core_update($update);
            echo '</li>';
        }
        echo '</ul>';
    }
}