Move widgets and importers to modules
This commit is contained in:
@@ -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,
|
||||
|
||||
Binary file not shown.
@@ -20,6 +20,8 @@
|
||||
<glyph unicode="" d="M301.84 256c3.44-12.24 5.36-25.12 5.36-38.4 0-77.76-63.040-140.8-140.8-140.8s-140.8 63.040-140.8 140.8 63.040 140.8 140.8 140.8h89.6v-25.6c0-14.16 11.44-25.6 25.6-25.6s25.6 11.44 25.6 25.6v25.6h179.2v-102.4h-184.56z" />
|
||||
<glyph unicode="" d="M459.6 307.2h-76.8v-179.2h-256v179.2h-76.8v102.4h132.4c10.56-29.84 38.96-51.2 72.4-51.2s61.84 21.36 72.4 51.2h132.4v-102.4zM382.8 102.4v-51.2h-256v51.2h256z" />
|
||||
<glyph unicode="" d="M435.2 204.8c0-98.96-80.24-179.2-179.2-179.2s-179.2 80.24-179.2 179.2c0 49.52 20.080 94.32 52.48 126.72v0l126.72 126.72 126.72-126.72c32.4-32.4 52.48-77.2 52.48-126.72zM343.28 298l-87.44 87.44-89.040-89.040c-23.84-23.28-38.8-55.6-38.8-91.6 0-70.72 57.28-128 128-128s128 57.28 128 128c0 36.88-15.76 69.84-40.72 93.2zM256 102.4l0.080 246.8 70.4-70.4c19.6-18.64 31.92-44.8 31.92-74 0-56.56-45.84-102.4-102.4-102.4z" />
|
||||
<glyph unicode="" d="M435.2 256c-14.16 0-25.6-11.44-25.6-25.6v-153.6h-307.2v153.6c0 14.16-11.44 25.6-25.6 25.6s-25.6-11.44-25.6-25.6v-179.2c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v179.2c0 14.16-11.44 25.6-25.6 25.6zM281.6 256v156.72c0 12.4-11.44 22.48-25.6 22.48s-25.6-10.080-25.6-22.48v-156.72h-76.8l102.4-102.4 102.4 102.4h-76.8z" />
|
||||
<glyph unicode="" d="M435.2 256c-14.16 0-25.6-11.44-25.6-25.6v-153.6h-307.2v153.6c0 14.16-11.44 25.6-25.6 25.6s-25.6-11.44-25.6-25.6v-179.2c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v179.2c0 14.16-11.44 25.6-25.6 25.6zM230.4 179.2c0-14.16 11.44-25.6 25.6-25.6s25.6 11.44 25.6 25.6v153.6h76.8l-102.4 102.4-102.4-102.4h76.8v-153.6z" />
|
||||
<glyph unicode="" d="M256 25.6c-113.12 0-204.8 91.68-204.8 204.8s91.68 204.8 204.8 204.8 204.8-91.68 204.8-204.8-91.68-204.8-204.8-204.8zM256 384c-84.8 0-153.6-68.8-153.6-153.6s68.8-153.6 153.6-153.6 153.6 68.8 153.6 153.6-68.8 153.6-153.6 153.6zM331.28 138.080l-4.48-2.64-12.96-7.92-7.68-5.6c-5.68-2.72-11.68-4.88-17.76-6.72v7.52l-2.16 17.36c0 0-1.040 10-2.72 12.64-1.6 2.64-5.44 6.32-9.2 7.92s-6.48 1.6-8.64 4.16c-2.16 2.64-3.84 7.36-6.48 11.6-2.72 4.24-6 8.48-6 10.56s0 23.76 0 23.76l2.72 20 5.92 4.24 7.040 7.92 4.88 1.6 16.8-3.12h11.84l4.88-10 11.36-8.96 7.040-11.040 9.2-3.12h10.32l7.040-8.48 4.32-8.96 1.6-6.32v-10.56l-1.12-6.24c-6.8-11.28-15.52-21.2-25.76-29.6v0zM289.36 319.92l-11.92-6.32-4.32-12.16-7.040-6.32h-23.36l-10.8-4.24-0.56-8.4-4.32-6.88-1.12-7.36 2.16-6.32 2.72-6.32c0 0 6.56-7.36 0-12.64 0 0-8.16 0-9.76 2.64s-13.52 10-15.76 12.16c-2.16 2.080-9.2 4.16-9.2 4.16l-8.64 3.2-8.16 0.56 0.56 11.040-0.56 9.44-3.28 6.88-9.2 6.88-0.56 7.36 1.12 4.080c21.92 21.2 52.16 34.4 85.6 34.4 18.88 0 36.48-4.56 52.4-12l-0.32-2.8-15.68-11.040z" />
|
||||
<glyph unicode="" d="M409.68 332.72c0 25.76-25.6 25.76-25.6 25.76h-256.24c0 0-25.6 0-25.6-25.76v-25.76h307.44v25.76zM332.8 409.92h-153.68c0 0-25.6 0-25.6-25.76h204.88c0 25.76-25.6 25.76-25.6 25.76v0zM449.2 309.36c-14.32 12.72-14.32 12.72-14.32 12.72v-40.72h-358v40.72c0 0 0 0-14.32-12.72s-24.56-16.16-18.8-43.12c5.68-26.8 33.44-174 37.6-193.92 4.56-21.84 29.52-21.52 29.52-21.52h289.92c0 0 25.040-0.32 29.52 21.52 4.16 19.92 31.84 167.040 37.6 193.92 5.84 26.96-4.4 30.4-18.72 43.12v0zM358.48 179.12c0 0 0-25.76-25.68-25.76h-153.76c-25.6 0-25.6 25.76-25.6 25.76v51.52h26.24v-50.88h153.28v50.88h25.52v-51.52z" />
|
||||
<glyph unicode="" d="M384 286v149.2h25.6c14.16 0 25.6-11.44 25.6-25.6v-51.2c0-33.44-21.36-61.84-51.2-72.4zM153.6 51.52h204.8v-51.52h-204.8v51.52zM179.2 76.8l25.6 25.6h25.6v25.6l25.6 25.6 25.6-25.6v-25.6h25.6l25.6-25.6h-153.6zM256 179.2c-56.56 0-102.4 45.84-102.4 102.4v179.2h204.8v-179.2c0-56.56-45.84-102.4-102.4-102.4zM76.8 358.4v51.2c0 14.16 11.44 25.6 25.6 25.6h25.6v-149.2c-29.84 10.56-51.2 38.96-51.2 72.4z" />
|
||||
|
||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 18 KiB |
Binary file not shown.
Binary file not shown.
@@ -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' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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',
|
||||
|
||||
62
modules/sportspress-importers.php
Normal file
62
modules/sportspress-importers.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: SportsPress Importers
|
||||
Plugin URI: http://themeboy.com/
|
||||
Description: Add importers to SportsPress.
|
||||
Author: ThemeBoy
|
||||
Author URI: http://themeboy.com/
|
||||
Version: 1.7
|
||||
*/
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'SportsPress_Importers' ) ) :
|
||||
|
||||
/**
|
||||
* Main SportsPress Importers Class
|
||||
*
|
||||
* @class SportsPress_Importers
|
||||
* @version 1.7
|
||||
*/
|
||||
class SportsPress_Importers {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
// Define constants
|
||||
$this->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();
|
||||
}
|
||||
63
modules/sportspress-widgets.php
Normal file
63
modules/sportspress-widgets.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: SportsPress Widgets
|
||||
Plugin URI: http://themeboy.com/
|
||||
Description: Add widgets to SportsPress.
|
||||
Author: ThemeBoy
|
||||
Author URI: http://themeboy.com/
|
||||
Version: 1.7
|
||||
*/
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'SportsPress_Widgets' ) ) :
|
||||
|
||||
/**
|
||||
* Main SportsPress Widgets Class
|
||||
*
|
||||
* @class SportsPress_Widgets
|
||||
* @version 1.7
|
||||
*/
|
||||
class SportsPress_Widgets {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
// Define constants
|
||||
$this->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();
|
||||
}
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user