-
Notifications
You must be signed in to change notification settings - Fork 0
/
findbiz-core.php
63 lines (51 loc) · 1.64 KB
/
findbiz-core.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
57
58
59
60
61
62
63
<?php
/*
Plugin Name: Findbiz Core
Plugin URI: https://directorist.com/
Description: Core plugin of FindBiz Theme.
Author: WpWax
Author URI: https://wpwax.com
Domain Path: /languages
Text Domain: findbiz-core
Version: 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class FindBiz_Core {
protected static $instance;
public static $base_dir;
public static $base_url;
public $plugin = 'findbiz-core';
public $prefix = 'findbiz';
public function __construct() {
self::$base_dir = plugin_dir_path( __FILE__ );
self::$base_url = plugin_dir_url( __FILE__ );
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ), 20 );
add_action( 'findbiz_theme_init_before', array( $this, 'theme_init_before' ) );
add_action( 'findbiz_theme_init_after', array( $this, 'theme_init_after' ) );
}
public static function instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
public function load_textdomain() {
load_plugin_textdomain( $this->plugin, false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
public function theme_init_before() {
if ( ! class_exists( 'CSF' ) ) {
require_once self::$base_dir . 'lib/cdf/codestar-framework.php'; // Codestar Framework
}
}
public function theme_init_after() {
require_once self::$base_dir . 'inc/helper.php';
require_once self::$base_dir . 'widgets/init.php'; // Widgets
require_once self::$base_dir . 'inc/demo-importer.php'; // Configuration of demo importing system
if ( did_action( 'elementor/loaded' ) ) {
require_once self::$base_dir . 'elementor/init.php'; // Elementor widgets
}
}
}
FindBiz_Core::instance();