LLMS_Abstract_Email_Provider::activate_already_installed_plugin()

Determines if the plugin is already installed and activates it if it is


Return Return

(boolean|WP_Error) true when plugin is installed and successfully activated. WP_Error when plugin is installed and there was an error activating it. false when plugin is not installed.


Top ↑

Source Source

File: includes/abstracts/llms-abstract-email-provider.php

	protected function activate_already_installed_plugin() {

		$is_plugin_installed = false;

		foreach ( get_plugins() as $path => $details ) {
			if ( false === strpos( $path, '/' . $this->id . '.php' ) ) {
				continue;
			}
			$is_plugin_installed = true;
			$activate            = activate_plugin( $path );
			if ( is_wp_error( $activate ) ) {
				return $activate;
			}
			break;
		}

		return $is_plugin_installed;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.40.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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