| 1 |
<?php |
| 2 |
/** |
| 3 |
* Author Box |
| 4 |
* |
| 5 |
* @package Powerkit |
| 6 |
* @subpackage Modules |
| 7 |
*/ |
| 8 |
|
| 9 |
/** |
| 10 |
* Init module |
| 11 |
*/ |
| 12 |
class Powerkit_Author_Box extends Powerkit_Module { |
| 13 |
|
| 14 |
/** |
| 15 |
* Register module |
| 16 |
*/ |
| 17 |
public function register() { |
| 18 |
$this->name = esc_html__( 'Author Box', 'powerkit' ); |
| 19 |
$this->desc = esc_html__( 'Display a post author box in your sidebar, including author name, bio and avatar in multiple available layouts.', 'powerkit' ); |
| 20 |
$this->slug = 'author_box'; |
| 21 |
$this->type = 'default'; |
| 22 |
$this->category = 'widget'; |
| 23 |
$this->priority = 160; |
| 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' ) . '/author-box/', |
| 30 |
'target' => '_blank', |
| 31 |
), |
| 32 |
); |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* Initialize module |
| 37 |
*/ |
| 38 |
public function initialize() { |
| 39 |
// Helpers Functions for the module. |
| 40 |
require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-author-box.php'; |
| 41 |
|
| 42 |
// The classes responsible for defining all actions. |
| 43 |
require_once dirname( __FILE__ ) . '/public/class-powerkit-author-box-widget.php'; |
| 44 |
|
| 45 |
if ( function_exists( 'register_block_type' ) ) { |
| 46 |
require_once dirname( __FILE__ ) . '/public/class-powerkit-author-box-block.php'; |
| 47 |
} |
| 48 |
|
| 49 |
// Admin and public area. |
| 50 |
require_once dirname( __FILE__ ) . '/public/class-powerkit-author-box-public.php'; |
| 51 |
|
| 52 |
new Powerkit_Author_Box_Public( $this->slug ); |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
new Powerkit_Author_Box(); |
| 57 |
|