Unyson
Unyson copied to clipboard
How can I disable an extension?
Hello,
Is it possible to disable an extension on the fly without removing it from extensions directory?
Thanks
I found a way but I don't know if it is correct or may cause issues
function my_deactivate_extensions() {
fw()->extensions->manager->deactivate_extensions(
array(
'blog' => array(),
'update' => array(),
)
);
}
add_action( 'fw_init', 'my_deactivate_extensions' );
Hi, You can simply deactivate the unnecessary extensions from the Unyson menu from your WP dashboard: https://static.md/914f009d7e6764b666637cd2ef2b6b5c.png.
Yes, is corect your code but depends on the context in which you use it, another way:
if ( ( $e = get_option( 'fw_active_extensions' ) ) && isset( $e['analytics'] ) ) {
unset( $e['analytics'] );
update_option( 'fw_active_extensions', $e );
}