dismissed_updates

函式
dismissed_updates ( No parameters )

dismissed_updates: 這個函式返回一個被使用者駁回的更新型別的陣列。它檢查dismissed_updates選項並返回其值,這是一個已被駁回的更新型別的陣列。

顯示被駁回的更新。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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>';
}
}
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>'; } }
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>';
	}
}

常見問題

FAQs
檢視更多 >