| 1 |
<?php |
| 2 |
/** |
| 3 |
* Facebook Integration |
| 4 |
* |
| 5 |
* @package Powerkit |
| 6 |
* @subpackage Modules |
| 7 |
*/ |
| 8 |
|
| 9 |
/** |
| 10 |
* Init module |
| 11 |
*/ |
| 12 |
class Powerkit_Facebook extends Powerkit_Module { |
| 13 |
|
| 14 |
/** |
| 15 |
* Register module |
| 16 |
*/ |
| 17 |
public function register() { |
| 18 |
$this->name = esc_html__( 'Facebook Integration', 'powerkit' ); |
| 19 |
$this->desc = esc_html__( 'Display your Facebook Fanpage widget in your sidebar or post content via a shortcode. Enable Facebook comments next to or instead of WordPress comments.', 'powerkit' ); |
| 20 |
$this->slug = 'facebook_integration'; |
| 21 |
$this->type = 'default'; |
| 22 |
$this->category = 'social'; |
| 23 |
$this->priority = 30; |
| 24 |
$this->public = true; |
| 25 |
$this->enabled = true; |
| 26 |
$this->load_extensions = array( |
| 27 |
'connect', |
| 28 |
); |
| 29 |
$this->links = array( |
| 30 |
array( |
| 31 |
'name' => esc_html__( 'Go to settings', 'powerkit' ), |
| 32 |
'url' => admin_url( sprintf( 'options-discussion.php#%s', powerkit_get_page_slug( $this->slug ) ) ), |
| 33 |
), |
| 34 |
array( |
| 35 |
'name' => esc_html__( 'View documentation', 'powerkit' ), |
| 36 |
'url' => powerkit_get_setting( 'documentation' ) . '/social-integrations/facebook-integration/', |
| 37 |
'target' => '_blank', |
| 38 |
), |
| 39 |
); |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* Initialize module |
| 44 |
*/ |
| 45 |
public function initialize() { |
| 46 |
|
| 47 |
/* Load the required dependencies for this module */ |
| 48 |
|
| 49 |
// Helpers Functions for the module. |
| 50 |
require_once dirname( __FILE__ ) . '/helpers/helper-powerkit-facebook.php'; |
| 51 |
|
| 52 |
// The classes responsible for defining all actions. |
| 53 |
require_once dirname( __FILE__ ) . '/public/class-powerkit-facebook-public.php'; |
| 54 |
require_once dirname( __FILE__ ) . '/public/class-powerkit-facebook-fanpage-widget.php'; |
| 55 |
require_once dirname( __FILE__ ) . '/public/class-powerkit-facebook-fanpage-shortcode.php'; |
| 56 |
|
| 57 |
// Gutenberg blocks. |
| 58 |
if ( function_exists( 'register_block_type' ) ) { |
| 59 |
require_once dirname( __FILE__ ) . '/public/class-powerkit-facebook-fanpage-block.php'; |
| 60 |
} |
| 61 |
|
| 62 |
// Admin and public area. |
| 63 |
require_once dirname( __FILE__ ) . '/admin/class-powerkit-facebook-admin.php'; |
| 64 |
require_once dirname( __FILE__ ) . '/public/class-powerkit-facebook-public.php'; |
| 65 |
|
| 66 |
new Powerkit_Facebook_Admin( $this->slug ); |
| 67 |
new Powerkit_Facebook_Public( $this->slug ); |
| 68 |
} |
| 69 |
} |
| 70 |
|
| 71 |
new Powerkit_Facebook(); |
| 72 |
|