| @@ -5,48 +5,50 @@ | ||
| 5 | 5 | * @package Powerkit |
| 6 | 6 | * @subpackage Modules |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -/** | |
| 10 | - * Init module | |
| 11 | - */ | |
| 12 | -class Powerkit_Posts extends Powerkit_Module { | |
| 13 | - | |
| 9 | +if ( class_exists( 'Powerkit_Module' ) ) { | |
| 14 | 10 | /** |
| 15 | - * Register module | |
| 11 | + * Init module | |
| 16 | 12 | */ |
| 17 | - public function register() { | |
| 18 | - $this->name = esc_html__( 'Posts', 'powerkit' ); | |
| 19 | - $this->desc = esc_html__( 'Display a list of posts in your sidebar, including post meta and preview image in multiple available layouts.', 'powerkit' ); | |
| 20 | - $this->slug = 'posts'; | |
| 21 | - $this->type = 'default'; | |
| 22 | - $this->category = 'content'; | |
| 23 | - $this->priority = 150; | |
| 24 | - $this->public = true; | |
| 25 | - $this->enabled = true; | |
| 26 | - $this->links = array( | |
| 27 | - array( | |
| 28 | - 'name' => esc_html__( 'View documentation', 'powerkit' ), | |
| 29 | - 'url' => powerkit_get_setting( 'documentation' ) . '/posts/', | |
| 30 | - 'target' => '_blank', | |
| 31 | - ), | |
| 32 | - ); | |
| 33 | - } | |
| 13 | + class Powerkit_Posts extends Powerkit_Module { | |
| 34 | 14 | |
| 35 | - /** | |
| 36 | - * Initialize module | |
| 37 | - */ | |
| 38 | - public function initialize() { | |
| 39 | - // Helpers Functions for the module. | |
| 40 | - require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-posts.php'; | |
| 15 | + /** | |
| 16 | + * Register module | |
| 17 | + */ | |
| 18 | + public function register() { | |
| 19 | + $this->name = esc_html__( 'Posts', 'powerkit' ); | |
| 20 | + $this->desc = esc_html__( 'Display a list of posts in your sidebar, including post meta and preview image in multiple available layouts.', 'powerkit' ); | |
| 21 | + $this->slug = 'posts'; | |
| 22 | + $this->type = 'default'; | |
| 23 | + $this->category = 'content'; | |
| 24 | + $this->priority = 150; | |
| 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' ) . '/posts/', | |
| 31 | + 'target' => '_blank', | |
| 32 | + ), | |
| 33 | + ); | |
| 34 | + } | |
| 41 | 35 | |
| 42 | - // The classes responsible for defining all actions. | |
| 43 | - require_once dirname( __FILE__ ) . '/public/class-powerkit-posts-widget.php'; | |
| 36 | + /** | |
| 37 | + * Initialize module | |
| 38 | + */ | |
| 39 | + public function initialize() { | |
| 40 | + // Helpers Functions for the module. | |
| 41 | + require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-posts.php'; | |
| 44 | 42 | |
| 45 | - // Admin and public area. | |
| 46 | - require_once dirname( __FILE__ ) . '/public/class-powerkit-posts-public.php'; | |
| 43 | + // The classes responsible for defining all actions. | |
| 44 | + require_once dirname( __FILE__ ) . '/public/class-powerkit-posts-widget.php'; | |
| 47 | 45 | |
| 48 | - new Powerkit_Posts_Public( $this->slug ); | |
| 46 | + // Admin and public area. | |
| 47 | + require_once dirname( __FILE__ ) . '/public/class-powerkit-posts-public.php'; | |
| 48 | + | |
| 49 | + new Powerkit_Posts_Public( $this->slug ); | |
| 50 | + } | |
| 49 | 51 | } |
| 52 | + | |
| 53 | + new Powerkit_Posts(); | |
| 50 | 54 | } |
| 51 | - | |
| 52 | -new Powerkit_Posts(); | |