diff --git a/assets/css/menu.css b/assets/css/menu.css index c087e7c5..bdadec72 100644 --- a/assets/css/menu.css +++ b/assets/css/menu.css @@ -113,6 +113,12 @@ .sp-icon-popup:before { content: "\f504"; } +.sp-icon-import:before { + content: "\f316"; +} +.sp-icon-export:before { + content: "\f317"; +} #adminmenu #toplevel_page_sportspress .toplevel_page_sportspress div.wp-menu-image:before, #adminmenu #menu-posts-sp_event .menu-icon-sp_event div.wp-menu-image:before, diff --git a/assets/fonts/sportspress.eot b/assets/fonts/sportspress.eot index 347aa905..22865901 100755 Binary files a/assets/fonts/sportspress.eot and b/assets/fonts/sportspress.eot differ diff --git a/assets/fonts/sportspress.svg b/assets/fonts/sportspress.svg index db35def3..119c9188 100755 --- a/assets/fonts/sportspress.svg +++ b/assets/fonts/sportspress.svg @@ -20,6 +20,8 @@ + + diff --git a/assets/fonts/sportspress.ttf b/assets/fonts/sportspress.ttf index afa503da..12159c3f 100755 Binary files a/assets/fonts/sportspress.ttf and b/assets/fonts/sportspress.ttf differ diff --git a/assets/fonts/sportspress.woff b/assets/fonts/sportspress.woff index 080e75b0..d33ea23d 100755 Binary files a/assets/fonts/sportspress.woff and b/assets/fonts/sportspress.woff differ diff --git a/includes/admin/class-sp-admin.php b/includes/admin/class-sp-admin.php index 0e64ca3b..25991c26 100644 --- a/includes/admin/class-sp-admin.php +++ b/includes/admin/class-sp-admin.php @@ -55,10 +55,6 @@ class SP_Admin { include( 'class-sp-admin-editor.php' ); endif; } - - // Importers - if ( defined( 'WP_LOAD_IMPORTERS' ) ) - include( 'class-sp-admin-importers.php' ); } /** diff --git a/includes/class-sp-modules.php b/includes/class-sp-modules.php index 2474bba7..a7ed678b 100644 --- a/includes/class-sp-modules.php +++ b/includes/class-sp-modules.php @@ -86,6 +86,14 @@ class SP_Modules { 'label' => __( 'Tutorials', 'sportspress' ), 'icon' => 'dashicons dashicons-video-alt3', ), + 'widgets' => array( + 'label' => __( 'Widgets', 'sportspress' ), + 'icon' => 'dashicons dashicons-welcome-widgets-menus', + ), + 'importers' => array( + 'label' => __( 'Importers', 'sportspress' ), + 'icon' => 'sp-icon-import', + ), 'twitter' => array( 'label' => __( 'Twitter', 'sportspress' ), 'class' => 'SportsPress_Twitter', diff --git a/modules/sportspress-importers.php b/modules/sportspress-importers.php new file mode 100644 index 00000000..040148f8 --- /dev/null +++ b/modules/sportspress-importers.php @@ -0,0 +1,62 @@ +define_constants(); + + add_action( 'init', array( $this, 'includes' ) ); + } + + /** + * Define constants. + */ + private function define_constants() { + if ( !defined( 'SP_IMPORTERS_VERSION' ) ) + define( 'SP_IMPORTERS_VERSION', '1.7' ); + + if ( !defined( 'SP_IMPORTERS_URL' ) ) + define( 'SP_IMPORTERS_URL', plugin_dir_url( __FILE__ ) ); + + if ( !defined( 'SP_IMPORTERS_DIR' ) ) + define( 'SP_IMPORTERS_DIR', plugin_dir_path( __FILE__ ) ); + } + + /** + * Include importers. + */ + public function includes() { + if ( is_admin() && defined( 'WP_LOAD_IMPORTERS' ) ) { + include( SP()->plugin_path() . '/includes/admin/class-sp-admin-importers.php' ); + } + } +} + +endif; + +if ( get_option( 'sportspress_load_importers_module', 'yes' ) == 'yes' ) { + new SportsPress_Importers(); +} diff --git a/modules/sportspress-widgets.php b/modules/sportspress-widgets.php new file mode 100644 index 00000000..1ca7634b --- /dev/null +++ b/modules/sportspress-widgets.php @@ -0,0 +1,63 @@ +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(); +} diff --git a/sportspress.php b/sportspress.php index f8eb0de7..41ba84fb 100644 --- a/sportspress.php +++ b/sportspress.php @@ -117,7 +117,6 @@ final class SportsPress { // Hooks add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'action_links' ) ); - add_action( 'widgets_init', array( $this, 'include_widgets' ) ); add_action( 'init', array( $this, 'init' ), 0 ); add_action( 'init', array( 'SP_Shortcodes', 'init' ) ); add_action( 'after_setup_theme', array( $this, 'setup_environment' ) ); @@ -263,15 +262,6 @@ final class SportsPress { } } - /** - * Include core widgets. - */ - public function include_widgets() { - include_once( 'includes/widgets/class-sp-widget-staff.php' ); - - do_action( 'sportspress_widgets' ); - } - /** * Init SportsPress when WordPress Initialises. */