Fix AJAX functionality for Install Now and Activate buttons
This commit is contained in:
@ -142,6 +142,13 @@ class WP_Allstars_Free_Plugins_Manager {
|
|||||||
if (response.success) {
|
if (response.success) {
|
||||||
// Add plugins to the container
|
// Add plugins to the container
|
||||||
$container.html(response.data);
|
$container.html(response.data);
|
||||||
|
|
||||||
|
// Initialize plugin action buttons (fix for AJAX install/activate functionality)
|
||||||
|
if (typeof initPluginActions === "function") {
|
||||||
|
initPluginActions();
|
||||||
|
} else if (typeof window.initPluginActions === "function") {
|
||||||
|
window.initPluginActions();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$container.html('<div class="notice notice-error"><p>' + response.data + '</p></div>');
|
$container.html('<div class="notice notice-error"><p>' + response.data + '</p></div>');
|
||||||
console.error('Error loading plugins:', response.data);
|
console.error('Error loading plugins:', response.data);
|
||||||
|
@ -295,6 +295,9 @@ jQuery(document).ready(function($) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Expose initPluginActions to global scope for use in other scripts
|
||||||
|
window.initPluginActions = initPluginActions;
|
||||||
|
|
||||||
// Initialize theme handlers
|
// Initialize theme handlers
|
||||||
function initThemeHandlers() {
|
function initThemeHandlers() {
|
||||||
console.log('Initializing theme handlers');
|
console.log('Initializing theme handlers');
|
||||||
|
Reference in New Issue
Block a user