Created
September 14, 2018 09:54
-
-
Save humayunahmed8/e71898b677d863faf18be7a4a8d0e1e4 to your computer and use it in GitHub Desktop.
Theme toolkit files
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
<?php | |
/* | |
Plugin Name: Stock Toolkit | |
Plugin URI: http://humayunbd.com | |
Description: Theme shortcode and visual composer addons here. | |
Version: 1.2 | |
Author: Humayun Ahemed | |
Author URI: http://humayunbd.com | |
*/ | |
// Exit if accessed directly | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
// Define | |
define('STOCK_ACC_URL', WP_PLUGIN_URL . '/' . plugin_basename( dirname( __FILE__ ) ) . '/'); | |
define('STOCK_ACC_PATH', plugin_dir_path( __FILE__ )); | |
// Print Shortcode in Widget | |
add_filter('widget_text', 'do_shortcode'); | |
// Loading VC addons | |
require_once( STOCK_ACC_PATH . 'vc-addons/vc-blocks-load.php'); | |
// Slides Shortcodes | |
require_once( STOCK_ACC_PATH . 'theme-shortcodes/slides-shortcode.php'); | |
// Shortcodes depended on Visual Composer | |
include_once(ABSPATH . 'wp-admin/includes/plugin.php'); | |
if (is_plugin_active( 'js_composer/js_composer.php' )) { | |
require_once( STOCK_ACC_PATH . 'theme-shortcodes/example-shortcode.php'); | |
} | |
// Registering stock toolkit files | |
function stock_toolkit_files(){ | |
wp_enqueue_style('owl-carousel', plugin_dir_url( __FILE__ ) . 'assets/css/owl.carousel.min.css'); | |
wp_enqueue_style('stock-toolkit-css', plugin_dir_url( __FILE__ ) . 'assets/css/stock-toolkit.css'); | |
wp_enqueue_script('owl-carousel', plugin_dir_url( __FILE__ ) . 'assets/js/owl.carousel.min.js', array('jquery'), '1.8', true) ; | |
} | |
add_action('wp_enqueue_scripts', 'stock_toolkit_files'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment