Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

How can I disable an extension?

Open BassemN opened this issue 9 years ago • 3 comments

Hello,

Is it possible to disable an extension on the fly without removing it from extensions directory?

Thanks

BassemN avatar Sep 26 '17 07:09 BassemN

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' );

BassemN avatar Sep 26 '17 08:09 BassemN

Hi, You can simply deactivate the unnecessary extensions from the Unyson menu from your WP dashboard: https://static.md/914f009d7e6764b666637cd2ef2b6b5c.png.

steve-themefuse avatar Sep 27 '17 12:09 steve-themefuse

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 ); }

ViorelEremia avatar Sep 28 '17 09:09 ViorelEremia