← All changes
|
modules/basic-elements/class-powerkit-basic-elements.php
+39
-41
3.1.0
→
2.4.6
View file →
| @@ -5,56 +5,54 @@ | ||
| 5 | 5 | * @package Powerkit |
| 6 | 6 | * @subpackage Modules |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( class_exists( 'Powerkit_Module' ) ) { | |
| 9 | +/** | |
| 10 | + * Init module | |
| 11 | + */ | |
| 12 | +class Powerkit_Basic_Elements extends Powerkit_Module { | |
| 13 | + | |
| 10 | 14 | /** |
| 11 | - * Init module | |
| 15 | + * Register module | |
| 12 | 16 | */ |
| 13 | - class Powerkit_Basic_Elements extends Powerkit_Module { | |
| 17 | + public function register() { | |
| 18 | + $this->name = esc_html__( 'Basic Elements', 'powerkit' ); | |
| 19 | + $this->desc = esc_html__( 'Basic shortcodes with a shortcode generator right in the WordPress editor.', 'powerkit' ); | |
| 20 | + $this->slug = 'basic_elements'; | |
| 21 | + $this->type = 'default'; | |
| 22 | + $this->category = 'basic'; | |
| 23 | + $this->priority = 80; | |
| 24 | + $this->public = true; | |
| 25 | + $this->enabled = true; | |
| 14 | 26 | |
| 15 | - /** | |
| 16 | - * Register module | |
| 17 | - */ | |
| 18 | - public function register() { | |
| 19 | - $this->name = powerkit_esc_html__( 'Basic Elements', 'powerkit' ); | |
| 20 | - $this->desc = powerkit_esc_html__( 'Basic shortcodes with a shortcode generator right in the WordPress editor.', 'powerkit' ); | |
| 21 | - $this->slug = 'basic_elements'; | |
| 22 | - $this->type = 'default'; | |
| 23 | - $this->category = 'basic'; | |
| 24 | - $this->priority = 80; | |
| 25 | - $this->public = true; | |
| 26 | - $this->enabled = true; | |
| 27 | + $this->links = array( | |
| 28 | + array( | |
| 29 | + 'name' => esc_html__( 'View documentation', 'powerkit' ), | |
| 30 | + 'url' => powerkit_get_setting( 'documentation' ) . '/content-presentation/basic-elements/', | |
| 31 | + 'target' => '_blank', | |
| 32 | + ), | |
| 33 | + ); | |
| 34 | + } | |
| 27 | 35 | |
| 28 | - $this->links = array( | |
| 29 | - array( | |
| 30 | - 'name' => powerkit_esc_html__( 'View documentation', 'powerkit' ), | |
| 31 | - 'url' => powerkit_get_setting( 'documentation' ) . '/content-presentation/basic-elements/', | |
| 32 | - 'target' => '_blank', | |
| 33 | - ), | |
| 34 | - ); | |
| 35 | - } | |
| 36 | + /** | |
| 37 | + * Initialize module | |
| 38 | + */ | |
| 39 | + public function initialize() { | |
| 36 | 40 | |
| 37 | - /** | |
| 38 | - * Initialize module | |
| 39 | - */ | |
| 40 | - public function initialize() { | |
| 41 | + /* Load the required dependencies for this module */ | |
| 41 | 42 | |
| 42 | - /* Load the required dependencies for this module */ | |
| 43 | + // Helpers Functions for the module. | |
| 44 | + require_once dirname( __FILE__ ) . '/helpers/helper-basic-elements.php'; | |
| 43 | 45 | |
| 44 | - // Helpers Functions for the module. | |
| 45 | - require_once dirname( __FILE__ ) . '/helpers/helper-basic-elements.php'; | |
| 46 | + // Admin and public area. | |
| 47 | + require_once dirname( __FILE__ ) . '/admin/class-powerkit-basic-elements-admin.php'; | |
| 48 | + require_once dirname( __FILE__ ) . '/public/class-powerkit-basic-elements-public.php'; | |
| 46 | 49 | |
| 47 | - // Admin and public area. | |
| 48 | - require_once dirname( __FILE__ ) . '/admin/class-powerkit-basic-elements-admin.php'; | |
| 49 | - require_once dirname( __FILE__ ) . '/public/class-powerkit-basic-elements-public.php'; | |
| 50 | + // Include default templates. | |
| 51 | + powerkit_basic_shortcodes_autoload( dirname( __FILE__ ) . '/templates' ); | |
| 50 | 52 | |
| 51 | - // Include default templates. | |
| 52 | - powerkit_basic_shortcodes_autoload( dirname( __FILE__ ) . '/templates' ); | |
| 53 | - | |
| 54 | - new Powerkit_Basic_Elements_Admin( $this->slug ); | |
| 55 | - new Powerkit_Basic_Elements_Public( $this->slug ); | |
| 56 | - } | |
| 53 | + new Powerkit_Basic_Elements_Admin( $this->slug ); | |
| 54 | + new Powerkit_Basic_Elements_Public( $this->slug ); | |
| 57 | 55 | } |
| 56 | +} | |
| 58 | 57 | |
| 59 | - new Powerkit_Basic_Elements(); | |
| 60 | -} | |
| 58 | +new Powerkit_Basic_Elements(); | |