| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: CoolClock |
| 4 |
Plugin URI: https://status301.net/wordpress-plugins/coolclock/ |
| 5 |
Description: Add an analog clock to your sidebar. |
| 6 |
Text Domain: coolclock |
| 7 |
Domain Path: languages |
| 8 |
Version: 4.0 |
| 9 |
Author: RavanH |
| 10 |
Author URI: https://status301.net/ |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 14 |
|
| 15 |
/************** |
| 16 |
* CLASSES |
| 17 |
**************/ |
| 18 |
|
| 19 |
require plugin_dir_path( __FILE__ ) . '/includes/class-coolclock.php'; |
| 20 |
require plugin_dir_path( __FILE__ ) . '/includes/class-coolclock-widget.php'; |
| 21 |
require plugin_dir_path( __FILE__ ) . '/includes/class-coolclock-shortcode.php'; |
| 22 |
|
| 23 |
/************** |
| 24 |
* HOOKS |
| 25 |
**************/ |
| 26 |
|
| 27 |
// text domain |
| 28 |
add_action( 'plugins_loaded', array( 'CoolClock', 'textdomain' ) ); |
| 29 |
|
| 30 |
// widgets |
| 31 |
add_action( 'widgets_init', array( 'CoolClock', 'register_widget' ) ); |
| 32 |
|
| 33 |
// enqueue scripts but only if shortcode or widget has been used |
| 34 |
add_action( 'wp_footer', array( 'CoolClock', 'enqueue_scripts' ), 9 ); |
| 35 |
|
| 36 |
/************** |
| 37 |
* SHORTCODE |
| 38 |
**************/ |
| 39 |
|
| 40 |
add_shortcode( 'coolclock', array( 'CoolClock_Shortcode', 'handle_shortcode' ) ); |
| 41 |
|
| 42 |
// prevent texturizing shortcode content |
| 43 |
add_filter( 'no_texturize_shortcodes', array( 'CoolClock_Shortcode', 'no_wptexturize') ); |
| 44 |
|
| 45 |
/************** |
| 46 |
* INITIATE |
| 47 |
**************/ |
| 48 |
|
| 49 |
new CoolClock( __FILE__ ); |
| 50 |
|