Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

Programmatically disable extensions

Open edvinbrobeck opened this issue 11 years ago • 3 comments

Is there a way to disable bundled extensions programmatically. I know it is possible by hiding with CSS (as referenced https://github.com/ThemeFuse/Unyson/issues/92)

But it doesn't really feel like the right way to proceed. Ideally i would like to have a filter to unset certain extension-handles.

Is there a way that I'm not aware of?

edvinbrobeck avatar Oct 09 '15 09:10 edvinbrobeck

$result = fw()->extensions->manager->deactivate_extensions(array(
    'extension_name' => array(),
));

ghost avatar Oct 09 '15 10:10 ghost

Sorry for the stupid question:

Where should this code go?

pnpetroff avatar Nov 14 '15 12:11 pnpetroff

Just came across. Here's a sample. Place this in your hooks.php or functions.php.

// This will force deactivate Styling extension because I don't need it. add_action('admin_footer', '_action_theme_disable_fw_styling'); function _action_theme_disable_fw_styling() { if (fw()->extensions->manager->can_activate() && fw_ext('styling')) { fw()->extensions->manager->deactivate_extensions(array('styling' => array())); } }

jonmlas avatar Mar 27 '17 16:03 jonmlas