Created
August 29, 2018 23:51
-
-
Save JMWebDevelopment/eb48e48508868fd0a3c57b88d4f54d5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JM_Portfolio { | |
protected $loader; | |
protected $plugin_slug; | |
protected $version; | |
public function __construct() { | |
$this->plugin_slug = 'jm-portfolio'; | |
$this->version = '1.0'; | |
$this->load_dependencies(); | |
$this->load_blocks(); | |
private function load_dependencies() { | |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-jm-portfolio-admin.php'; | |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-jm-portfolio-cpts.php'; | |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'blocks/class-jm-portfolio-blocks.php'; | |
require_once plugin_dir_path( __FILE__ ) . 'class-jm-portfolio-loader.php'; | |
$this->loader = new JM_Portfolio_Loader(); | |
} | |
private function load_blocks() { | |
$blocks = new JM_Portfolio_Blocks(); | |
$this->loader->add_action( 'enqueue_block_editor_assets', $blocks, 'jm_portfolio_add_scripts' ); | |
$this->loader->add_action( 'enqueue_block_assets', $blocks, 'jm_enqueue_front_end_assets' ); | |
$this->loader->add_action( 'init', $blocks, 'jm_portfolio_add_blocks' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment