| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: B Blocks |
| 4 |
* Plugin URI: http://bblockswp.com/ |
| 5 |
* Description: Gutenberg Blocks Collection and Page Builder. |
| 6 |
* Version: 1.0 |
| 7 |
* Author: bPlugins LLC |
| 8 |
* Author URI: http://bplugins.com |
| 9 |
* License: GPLv3 |
| 10 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt |
| 11 |
* Text Domain: b-blocks |
| 12 |
*/ |
| 13 |
|
| 14 |
// Block Initializer. |
| 15 |
require_once plugin_dir_path( __FILE__ ) . 'src/init.php'; |
| 16 |
|
| 17 |
// Constant |
| 18 |
define( 'B_BLOCKS_PLUGIN_VERSION', '1.0.0' ); |
| 19 |
define( "B_BLOCKS_ASSETS_DIR", plugin_dir_url( __FILE__ ) . 'assets/' ); |
| 20 |
|
| 21 |
// Public Assets |
| 22 |
function b_blocks_assets() { |
| 23 |
wp_enqueue_style( 'bootstrap', B_BLOCKS_ASSETS_DIR . 'css/bootstrap.min.css', '', '4.6.0', 'all' ); |
| 24 |
|
| 25 |
wp_enqueue_script( 'bootstrap', B_BLOCKS_ASSETS_DIR . 'js/bootstrap.bundle.min.js', array( 'jquery' ), '4.6.0', true ); |
| 26 |
wp_enqueue_script( 'mailtoui', B_BLOCKS_ASSETS_DIR . 'js/mailtoui-min.js', array(), B_BLOCKS_PLUGIN_VERSION, true ); |
| 27 |
wp_enqueue_script( 'b-blocks-script', B_BLOCKS_ASSETS_DIR . 'js/script.js', array( 'jquery', 'wp-tinymce' ), B_BLOCKS_PLUGIN_VERSION, true ); |
| 28 |
} |
| 29 |
add_action( 'wp_enqueue_scripts', 'b_blocks_assets' ); |
| 30 |
|
| 31 |
// Admin Assets |
| 32 |
function b_blocks_admin_assets( $screen ) { |
| 33 |
if ( 'post-new.php' == $screen || 'post.php' == $screen ) { |
| 34 |
wp_enqueue_style( 'bootstrap', B_BLOCKS_ASSETS_DIR . 'css/bootstrap.min.css', '', '4.6.0', 'all' ); |
| 35 |
|
| 36 |
wp_enqueue_script( 'bootstrap', B_BLOCKS_ASSETS_DIR . 'js/bootstrap.bundle.min.js', array( 'jquery' ), '4.6.0', true ); |
| 37 |
wp_enqueue_script( 'mailtoui', B_BLOCKS_ASSETS_DIR . 'js/mailtoui-min.js', array(), B_BLOCKS_PLUGIN_VERSION, true ); |
| 38 |
} |
| 39 |
} |
| 40 |
add_action( 'admin_enqueue_scripts', 'b_blocks_admin_assets' ); |