define_constants(); add_action( 'widgets_init', array( $this, 'includes' ) ); } /** * Define constants. */ private function define_constants() { if ( !defined( 'SP_WIDGETS_VERSION' ) ) define( 'SP_WIDGETS_VERSION', '1.7' ); if ( !defined( 'SP_WIDGETS_URL' ) ) define( 'SP_WIDGETS_URL', plugin_dir_url( __FILE__ ) ); if ( !defined( 'SP_WIDGETS_DIR' ) ) define( 'SP_WIDGETS_DIR', plugin_dir_path( __FILE__ ) ); } /** * Include widgets. */ public function includes() { include_once( SP()->plugin_path() . '/includes/widgets/class-sp-widget-sportspress.php' ); include_once( SP()->plugin_path() . '/includes/widgets/class-sp-widget-staff.php' ); do_action( 'sportspress_widgets' ); } } endif; if ( get_option( 'sportspress_load_widgets_module', 'yes' ) == 'yes' ) { new SportsPress_Widgets(); }