/
wp-knowledge-base-woocommerce.php
56 lines (43 loc) · 1.05 KB
/
wp-knowledge-base-woocommerce.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
Plugin Name: WP Knowledge Base - WooCommerce
Plugin URI: http://www.barrykooij.com/
Description: Lets WP Knowledge Base and WooCommerce play along nicely
Version: 1.0.0
Author: Never5
Author URI: http://www.never5.com/
License: GPL v2
*/
namespace WPKB\WooCommerce;
class WP_Knowledge_Base_WooCommerce {
/**
* Constructor
*/
public function __construct() {
require_once( 'classes/Breadcrumbs.php' );
require_once( 'classes/MetaBox.php' );
require_once( 'classes/Shortcode.php' );
$this->hooks();
}
/**
* Hooks
*/
private function hooks() {
// frontend only
if ( ! is_admin() ) {
// breadcrumbs
$breadcrumbs = new Breadcrumbs();
add_action( 'wp', array( $breadcrumbs, 'handleHooks' ) );
// setup shortcode on frontend
$shortcode = new Shortcode();
$shortcode->setup();
}
// setup product link
$productLink = new MetaBox();
$productLink->add_hooks();
}
}
function __wp_kb_wc_init() {
new WP_Knowledge_Base_WooCommerce();
}
add_action( 'plugins_loaded', '\WPKB\WooCommerce\__wp_kb_wc_init', 20 );