| 1 |
<?php |
| 2 |
|
| 3 |
if( ! class_exists( 'wp_mapit_widget' ) ) { |
| 4 |
|
| 5 |
/** |
| 6 |
* Class to manage widget for WP MAPIT |
| 7 |
*/ |
| 8 |
class wp_mapit_widget |
| 9 |
{ |
| 10 |
|
| 11 |
/** |
| 12 |
* Add hooks and filters for the widgets |
| 13 |
* |
| 14 |
* @since 1.0 |
| 15 |
* @static |
| 16 |
* @access public |
| 17 |
*/ |
| 18 |
public static function init() { |
| 19 |
add_action( 'widgets_init', __CLASS__ . '::widgets_init' ); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Hook to handle the widget_init action |
| 24 |
* |
| 25 |
* @since 1.0 |
| 26 |
* @static |
| 27 |
* @access public |
| 28 |
*/ |
| 29 |
public static function widgets_init() { |
| 30 |
register_widget( 'wp_mapit_contextual_map_widget' ); |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Calling init function to activate hooks and filters. |
| 36 |
*/ |
| 37 |
wp_mapit_widget::init(); |
| 38 |
} |