WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 2 months ago

#51832 new enhancement

Add a more visible way to delete unused themes

Reported by: tobifjellner Owned by:
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.5
Component: Themes Keywords: needs-design needs-screenshots dev-feedback
Focuses: ui, javascript, administration, rest-api, coding-standards Cc:

Description

Today (in WP 5.5) in order to delete a theme I don't use, I need to navigate to Appearance → Themes, then click on "Theme Details" that is only visible when a theme has focus and in the splash dialog, finally, hit "Delete".

Since the Health Check reminds users to remove themes they don't use, we systematically set people off looking for how to delete unused themes without finding (and then writing nervous posts in various help forums).

Let's add a more discoverable way!
On the "Themes" page, we could add a button at the top of the page (after the "Search installed themes" dialog) "Delete unused themes".
When you hit that button, you get a list of all your themes. Your current theme (and its parent theme, where applicable) would be inaccessible and "greyed out". All other themes would have selection boxes. At the top of the list there should be a two buttons: "Select all themes recommended for deletion" and "Delete selected themes".

Hmm. May words. Perhaps someone with suitable skills could draft a mock-up?

Attachments (1)

#51832.patch (4.6 KB) - added by 9primus 2 months ago.
Hello everyone. This is my patch for deleting multiple themes .Unfortunately it delete not all file in last version of wordpress. Plese , give me feedback about my patch

Download all attachments as: .zip

Change History (8)

This ticket was mentioned in Slack in #forums by tobifjellner. View the logs.


5 months ago

#2 @9primus
3 months ago

  • Focuses ui javascript administration rest-api coding-standards added

Hello tobifjellner!) I think I can implement your enhancement. See you soon here.

This ticket was mentioned in Slack in #core by 9primus. View the logs.


2 months ago

#4 @paaljoachim
2 months ago

  • Keywords needs-screenshots added

Hi

Please upload a screenshot and perhaps also an animated gif when ready. Thanks.
As it would give us a visual idea what it looks like.

@9primus
2 months ago

Hello everyone. This is my patch for deleting multiple themes .Unfortunately it delete not all file in last version of wordpress. Plese , give me feedback about my patch

#5 @9primus
2 months ago

  • Keywords dev-feedback added

It seems this function from my patch not delete all files, please give me feedback:

<?php
function Delete($path)
{
    if (is_dir($path) === true)
    {
                $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST);

        foreach ($files as $file)
        {
                        if ($file->isDir() === true)
                        {
                                rmdir($file->getPathName());
                        }

                        else if (($file->isFile() === true) || ($file->isLink() === true))
                        {
                                unlink($file->getPathname());
                        }
        }

        return rmdir($path);
    }

    else if ((is_file($path) === true) || (is_link($path) === true))
    {
        return unlink($path);
    }

    return false;
}
Last edited 2 months ago by 9primus (previous) (diff)

This ticket was mentioned in Slack in #core by sergey. View the logs.


2 months ago

#7 @SergeyBiryukov
2 months ago

  • Milestone changed from Awaiting Review to 5.8

Hi @9primus, thanks for the patch! Moving to the milestone for visibility and review.

Note: See TracTickets for help on using tickets.