| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly. |
| 5 |
} |
| 6 |
|
| 7 |
/* |
| 8 |
Plugin Name: BH Custom Preloader |
| 9 |
Plugin URI: https://wordpress.org/plugins/bh-custom-preloader/ |
| 10 |
Description: This is BH Custom Preloader WordPress plugin.It will be enable Preloader on your web site. You can change Every things from settings |
| 11 |
Author: Masum Billah |
| 12 |
Author URI: https://themesvila.com/ |
| 13 |
Version: 2.1 |
| 14 |
*/ |
| 15 |
|
| 16 |
|
| 17 |
//define |
| 18 |
|
| 19 |
define( 'BHCUSTOMPREPLUGINDIR', dirname( __FILE__ ) ); |
| 20 |
|
| 21 |
// Some configure |
| 22 |
define('BH_CUSTOM_PRELOADER_WORDPRESS' , WP_PLUGIN_URL .'/' . plugin_basename(dirname(__FILE__)) . '/'); |
| 23 |
|
| 24 |
// Adding css and jquery files |
| 25 |
function bh_custom_preloader_files(){ |
| 26 |
wp_enqueue_style('bh-preloader' , BH_CUSTOM_PRELOADER_WORDPRESS .'css/bh_custom_preloader.css' ); |
| 27 |
wp_enqueue_script('jquery'); |
| 28 |
wp_enqueue_script( 'bh-preloader', BH_CUSTOM_PRELOADER_WORDPRESS . '/assets/js/scripts.js', array('jquery'), '54895', true ); |
| 29 |
} |
| 30 |
|
| 31 |
add_action('wp_enqueue_scripts' , 'bh_custom_preloader_files'); |
| 32 |
|
| 33 |
// Added Setting Link |
| 34 |
add_filter( 'plugin_action_links_'.plugin_basename(__FILE__), 'bh_custom_preloader_settings_link' ); |
| 35 |
function bh_custom_preloader_settings_link($links) { |
| 36 |
$newlink = sprintf("<a href='%s'>%s</a>",'admin.php?page=bh-preloader',__('Settings','bh-scrolltop')); |
| 37 |
$links[] = $newlink; |
| 38 |
return $links; |
| 39 |
} |
| 40 |
|
| 41 |
// Add main files |
| 42 |
if( !class_exists( 'CSF' ) ) { |
| 43 |
|
| 44 |
include_once(BHCUSTOMPREPLUGINDIR. '/options/codestar-framework.php'); |
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
include_once(BHCUSTOMPREPLUGINDIR. '/functions.php'); |
| 49 |
include_once(BHCUSTOMPREPLUGINDIR. '/preloader.php'); |