| 1 |
<?php |
| 2 |
/** |
| 3 |
* Post Format UI |
| 4 |
* |
| 5 |
* @package Powerkit |
| 6 |
* @subpackage Modules |
| 7 |
*/ |
| 8 |
|
| 9 |
/** |
| 10 |
* Init module |
| 11 |
*/ |
| 12 |
class Powerkit_Post_Format_UI extends Powerkit_Module { |
| 13 |
|
| 14 |
/** |
| 15 |
* Register module |
| 16 |
*/ |
| 17 |
public function register() { |
| 18 |
$this->name = esc_html__( 'Post Format UI', 'powerkit' ); |
| 19 |
$this->desc = null; |
| 20 |
$this->slug = 'post_format_ui'; |
| 21 |
$this->type = 'default'; |
| 22 |
$this->category = 'basic'; |
| 23 |
$this->priority = 0; |
| 24 |
$this->public = false; |
| 25 |
$this->enabled = true; |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Initialize module |
| 30 |
*/ |
| 31 |
public function initialize() { |
| 32 |
|
| 33 |
/* Load the required dependencies for this module */ |
| 34 |
add_action( 'init', array( $this, 'deferred_init' ) ); |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Initialize based on theme customization |
| 39 |
*/ |
| 40 |
public function deferred_init() { |
| 41 |
if ( get_theme_support( 'powerkit-post-format-ui' ) ) { |
| 42 |
// Helpers Functions for the module. |
| 43 |
require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-post-format-ui.php'; |
| 44 |
|
| 45 |
// Admin and public area. |
| 46 |
require_once dirname( __FILE__ ) . '/admin/class-powerkit-post-format-ui-admin.php'; |
| 47 |
|
| 48 |
new Powerkit_Post_Format_UI_Admin( $this->slug ); |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
new Powerkit_Post_Format_UI(); |
| 54 |
|