Fix activation buttons for both free plugins grid and theme panel

This commit is contained in:
Marcus Quinn
2025-03-17 00:51:39 +00:00
parent d50dfd344c
commit 5f64feeaa8
3 changed files with 47 additions and 21 deletions

View File

@ -1312,6 +1312,13 @@ function wp_allstars_activate_theme() {
return;
}
// Get the theme object
$theme_obj = wp_get_theme($theme);
if (!$theme_obj->exists() || $theme_obj->errors()) {
wp_send_json_error('Theme does not exist');
return;
}
// Switch the theme
switch_theme($theme);