| 1 |
<?php |
| 2 |
/** |
| 3 |
* The public-facing functionality of the module. |
| 4 |
* |
| 5 |
* @link https://codesupply.co |
| 6 |
* @since 1.0.0 |
| 7 |
* |
| 8 |
* @package Powerkit |
| 9 |
* @subpackage Modules/public |
| 10 |
*/ |
| 11 |
|
| 12 |
/** |
| 13 |
* The public-facing functionality of the module. |
| 14 |
*/ |
| 15 |
class Powerkit_Twitter_Public extends Powerkit_Module_Public { |
| 16 |
|
| 17 |
/** |
| 18 |
* Initialize |
| 19 |
*/ |
| 20 |
public function initialize() { |
| 21 |
add_action( 'init', array( $this, 'register_templates' ) ); |
| 22 |
add_filter( 'powerkit_twitter_templates', array( $this, 'template_default' ) ); |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* Register Templates |
| 27 |
* |
| 28 |
* @since 1.0.0 |
| 29 |
* @access private |
| 30 |
* |
| 31 |
* @param array $templates List of Templates. |
| 32 |
*/ |
| 33 |
public function register_templates( $templates = array() ) { |
| 34 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/twitter-template.php'; |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Filter Register Templates |
| 39 |
* |
| 40 |
* @since 1.0.0 |
| 41 |
* @access private |
| 42 |
* |
| 43 |
* @param array $templates List of Templates. |
| 44 |
*/ |
| 45 |
public function template_default( $templates = array() ) { |
| 46 |
$templates = array( |
| 47 |
'default' => array( |
| 48 |
'name' => 'Default', |
| 49 |
'func' => 'powerkit_twitter_default_template', |
| 50 |
), |
| 51 |
); |
| 52 |
|
| 53 |
return $templates; |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* Register the stylesheets for the public-facing side of the site. |
| 58 |
*/ |
| 59 |
public function wp_enqueue_scripts() { |
| 60 |
wp_enqueue_style( 'powerkit-twitter', powerkit_style( plugin_dir_url( __FILE__ ) . 'css/public-powerkit-twitter.css' ), array(), powerkit_get_setting( 'version' ), 'all' ); |
| 61 |
|
| 62 |
// Add RTL support. |
| 63 |
wp_style_add_data( 'powerkit-twitter', 'rtl', 'replace' ); |
| 64 |
} |
| 65 |
} |
| 66 |
|