[wp-trac] [WordPress Trac] #54533: State more clearly that an active theme can't be deleted
WordPress Trac
noreply at wordpress.org
Sun Apr 27 07:38:50 UTC 2025
#54533: State more clearly that an active theme can't be deleted
---------------------------------------+---------------------------------
Reporter: tobifjellner | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: has-patch has-screenshots | Focuses: ui, administration
---------------------------------------+---------------------------------
Comment (by Presskopp):
somehow my patch vanished.
Here is the code:
{{{#!php
<?php
<# if ( data.active ) { #>
<?php
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Active: %s', 'theme' ), '{{
data.name }}' );
?>
<span class="cannot-delete-active-theme" aria-label="<?php
echo esc_attr( $aria_label ); ?>">
<?php _e( 'You cannot delete an active theme.' );
?>
</span>
<# } else if ( data.actions['delete'] ) { #>
<?php
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Delete %s', 'theme' ), '{{
data.name }}' );
?>
<a class="button delete-theme"
href="{{{ data.actions['delete'] }}}"
aria-label="<?php echo esc_attr( $aria_label );
?>"
><?php _e( 'Delete' ); ?></a>
<# } else { #>
<?php
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Cannot Delete %s', 'theme' ),
'{{ data.name }}' );
?>
<span class="parent-theme-notice" aria-label="<?php echo
esc_attr( $aria_label ); ?>">
<?php _e( 'You cannot delete a theme while it has
an active child theme.' ); ?>
</span>
<# } #>
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54533#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list