Ok frank, my coder, Charles fixed it. Here’s the solution for your reference:
CHARLES: The problem was that he was calling the export function outside of the WordPress context, then checking for user capabilities – but the user object hasn’t been set until everything has loaded. So it failed.
I fixed it by putting the call to the export function inside the ‘plugins_loaded’ hook, so it happens after everything is up and running.
CHARLES:
This was the faulty code in adminimize_page.php:
// Export the options to local client.
if ( array_key_exists( '_mw_adminimize_export', $_GET ) ) {
_mw_adminimize_export_json();
die();
}
I CHANGED IT TO:
// Export the options to local client.
add_action(
'plugins_loaded',
function() {
if ( array_key_exists( '_mw_adminimize_export', $_GET ) ) {
_mw_adminimize_export_json();
return;
}
}
);
-
This reply was modified 7 years, 6 months ago by
shoqvalue.