PUM_Extension_Activator::run()

Process plugin deactivation


Description Description


Source Source

File: classes/Extension/Activator.php

	public function run() {
		if ( $this->get_status() != 'active' ) {
			// Display notice
			add_action( 'admin_notices', array( $this, 'missing_popmake_notice' ) );
		} else {
			$class_name = $this->extension_class_name;

			// Generate an instance of the extension class in a PHP 5.2 compatible way.
			call_user_func( array( $class_name, 'instance' ) );

			$this->extension_file = $this->get_static_prop( $class_name, 'FILE' );

			$plugin_slug          = explode( '/', plugin_basename( $this->extension_file ), 2 );
			$this->extension_slug = str_replace( array( 'popup-maker-', 'pum-' ), '', $plugin_slug[0] );

			// Handle licensing for extensions with valid ID & not wp repo extensions.
			if ( $this->extension_id > 0 && ! $this->extension_wp_repo && class_exists( 'PUM_Extension_License' ) ) {
				new PUM_Extension_License( $this->extension_file, $this->extension_name, $this->extension_version, 'Popup Maker', null, null, $this->extension_id );
			}

			add_filter( 'pum_enabled_extensions', array( $this, 'enabled_extensions' ) );
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

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