LLMS_Add_On::activate()
Activate an add-on
Return Return
(string|WP_Error)
Source Source
File: includes/models/model.llms.add-on.php
public function activate() { $ret = false; if ( 'plugin' === $this->get( 'type' ) ) { $ret = activate_plugins( $this->get( 'update_file' ) ); } elseif ( 'theme' === $this->get( 'type' ) ) { $ret = true; switch_theme( $this->get( 'update_file' ) ); } if ( true === $ret ) { // Translators: %s = Add-on name. return sprintf( __( '%s was successfully activated.', 'lifterlms' ), $this->get( 'title' ) ); } // Translators: %s = Add-on name. return new WP_Error( 'activation', sprintf( __( 'Could not activate %s.', 'lifterlms' ), $this->get( 'title' ) ) ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.25.0 | Unknown. |
3.22.0 | Introduced. |