Astra_Ext_Extension::activate_extension( string $extension_name, boolean $force = true )

Activates the specified extension.


Description


Parameters

$extension_name

(string) (Required) Extension Name.

$force

(boolean) (Optional) Force to activate.

Default value: true


Return

(void)


Source

File: classes/class-astra-ext-extension.php

	public static function activate_extension( $extension_name, $force = true ) {
		// Get the list of currently enabled extensions.
		$extensions = self::get_enabled_addons();

		// Check if the extension needs to be activated.
		if ( ! isset( $extensions[ $extension_name ] ) || ( $force && ! $extensions[ $extension_name ] ) || $extensions[ $extension_name ] === false ) {
			$extensions[ $extension_name ] = $extension_name;
			Astra_Admin_Helper::update_admin_settings_option( '_astra_ext_enabled_extensions', $extensions );
		}
	}

Changelog

Changelog
Version Description
4.8.8 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.