Skip to main content

Extension system & update hooks

Hooks from the extension manager and the update system: extension activation/discovery, the available-extensions registry, download sources, and the GitHub auto-updater.

A frequently-used one points the auto-updater at a different branch:

add_filter( 'fw_ext_mngr_github_branch', function ( $branch, $user_repo ) {
return 'main';
}, 10, 2 );

For how extensions are discovered, ordered by their requirements, and activated, see The extension system.

Actions (16)

HookPasses to your callbackWhat it does
fw_after_plugin_activate:before_potential_redirectunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_after_supported_extensions_install_successFixes https://github.com/ThemeFuse/Unyson/issues/2330 (@since 2.6.14)
fw_backend_add_custom_extensions_menu$dataUse this action if you what to add the extensions page in a custom place in menu Usage example http://pastebin.com/2iWVRPAU
fw_extension_settings_form_render:unysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_extension_settings_form_saved:$options_before_saveunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_extensions_activation_failed$failed_extensionsunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_extensions_after_activation$succeeded_extensionsunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_extensions_after_deactivation$succeeded_extensionsunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_extensions_before_activation$extensions_for_activationunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_extensions_before_deactivation$extensions_for_deactivationunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_extensions_before_initExtensions are about to activate. You can add subclasses to FW_Extension at this point.
fw_extensions_deactivation_failed$failed_extensionsunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_extensions_initExtensions are activated Now $this->get_children() inside extensions is available
fw_extensions_install$resultunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_extensions_uninstall$resultunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_register_ext_download_sources$registerRegister download sources for extensions. Usage: $download_source = new FW_Ext_Download_Source(); $register->register($download_source);

Filters (15)

HookPasses to your callbackWhat it does
fw_after_switch_theme_activate_extstrueunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_backend_enable_custom_extensions_menutrueunysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php
fw_custom_url_version$set['remote'], $setunysonplus/framework/extensions/update/extensions/custom-update/class-fw-extension-custom-update.php
fw_ext_manager_settings_url$url_set, $name ?? '', $extLet an extension expose a custom Settings link on its card (e.g. one that points to a dedicated admin page instead of the built-in settings form). Return a URL to show the link, or '' to hide it.
fw_ext_mngr_github_branch'', $set['user_repo']Resolve the branch to download. Defaults to the repository's GitHub default branch; override via the filter if needed.
fw_ext_update_extensions_complete_actions$update_actionsFilter the list of action links available following extensions update. @param array $update_actions Array of plugin action links.
fw_ext_update_framework_complete_actions$update_actionsFilter the list of action links available following framework update. @param array $update_actions Array of plugin action links.
fw_ext_update_github_branchesarray('master', 'main'), $user_slash_repounysonplus/framework/extensions/update/extensions/github-update/class-fw-extension-github-update.php
fw_ext_update_theme_complete_actions$update_actionsFilter the list of action links available following theme update. @param array $update_actions Array of plugin action links.
fw_extensions_locations[]{ '/hello/world/extensions' => 'https://hello.com/world/extensions' }
fw_extensions_locations_after$locations(@since 2.6.9)
fw_extensions_page_show_other_extensionstrueunysonplus/framework/core/components/extensions/manager/views/extensions-page.php
fw_github_api_url'https://api.github.com'unysonplus/framework/core/components/extensions/manager/includes/download-source/types/class-fw-download-source-github.php
fw_theme_available_extensions_file_pathfw_get_framework_customizations_dir_rel_path( '/theme/available-extensions.php' )Allow theme to register available extensions
fw_tmp_dirfw_fix_path(WP_CONTENT_DIR) .'/tmp'unysonplus/framework/core/components/extensions/manager/class--fw-extensions-manager.php