/** * Construct Settings manager. * * @since 1.0.0 * @internal */ public function __construct() { parent::__construct(); $this->settings = MS_Plugin::instance()->settings; /** * Simple check to allow other plugins to quickly find out if * Membership2 is loaded and the API was initialized. * * Example: * if ( apply_filters( 'ms_active', false ) ) { ... } */ add_filter('ms_active', '__return_true'); /** * Make the API controller accessible via MS_Plugin::$api */ MS_Plugin::set_api($this); /** * Notify other plugins that Membership2 is ready. */ do_action('ms_init', $this); }
/** * Private constructor: Singleton pattern. * * @since 1.0.0 * @internal */ protected function __construct() { $this->settings = MS_Plugin::instance()->settings; /** * Simple check to allow other plugins to quickly find out if * Membership2 is loaded and the API was initialized. * * Example: * if ( apply_filters( 'ms_active', false ) ) { ... } * * @since 1.0.0 */ add_filter('ms_active', '__return_true'); /** * Make the API controller accessible via static property. * * Example: * $api = MS_Plugin::$api; * * Alternative: * $api = apply_filters( 'ms_api', false ); * * @since 1.0.0 */ MS_Plugin::set_api($this); /** * Notify other plugins that Membership2 is ready. * * @since 1.0.0 */ do_action('ms_init', $this); }