uninstall a theme programmaticlly

I'm working on a plugin that create, install, switch between child themes.

But I have a problem that my plugin creates just 2 or 3 child themes ( Is there any limit in creating child themes?).

So I'm looking for a way to delete a child theme programmatically by codes before throwing my function that create the other theme.

Thank you.

Topic child-theme functions uninstallation Wordpress

Category Web


  1. The limit of the child theme is not a border from WordPress, maybe your webspace.

  2. If you remove the directory of a child theme, include all files, if is deleted. For the delete of the folder use rmdir(). The method rmdir() is part of the classes that extend WP_Filesystem_Base, like WP_Filesystem_Direct and accordingly the rmdir() method in that class. Take a look at the the wp-admin/includes directory to inspect the other classes yourself.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.