Add modules tab to settings page

This commit is contained in:
Brian Miyaji
2015-01-21 23:49:03 +11:00
parent 790789c6b6
commit 82fee9dcee
18 changed files with 429 additions and 163 deletions

View File

@@ -199,6 +199,7 @@
font-family: monospace;
}
.sportspress .submit,
.sp-data-table-container {
clear: both;
}
@@ -486,6 +487,112 @@ table.widefat.sp-sortable-table tbody tr .icon {
border-left-color: #464646;
}
.sp-modules-wrapper {
margin-right: 300px;
max-width: 750px;
}
.sp-modules-main {
width: 100%;
float: left;
}
.sp-modules-sidebar {
float: right;
margin-right: -300px;
width: 280px;
}
.sp-modules-sidebar table th,
.sp-modules-sidebar table td {
padding: 10px 14px;
}
.sp-modules-sidebar table th img {
display: block;
}
.sp-modules-sidebar table td p {
margin-top: 0;
}
.sp-modules-sidebar table td .sp-module-actions {
padding: 10px;
clear: both;
border-top: 1px solid #ddd;
background: #f5f5f5;
margin: 0 -14px -10px;
text-align: right;
}
.sp-modules-sidebar table td .sp-module-actions span {
line-height: 28px;
vertical-align: middle;
text-align: left;
float: left;
margin-left: 4px;
color: #999;
}
.sp-modules-sidebar table td .sp-documentation-links {
margin: 0.25em 0;
}
.sp-modules-wrapper img {
max-width: 100%;
}
.sp-modules-wrapper table {
margin-bottom: 20px;
}
table.sp-modules-table td {
padding: 10px 14px;
line-height: 25px;
border-bottom: 1px solid #e1e1e1;
position: relative;
}
table.sp-modules-table tr:last-child td {
border-bottom: none;
}
table.sp-modules-table td > input[type=checkbox] {
margin-top: -4px;
}
table.sp-modules-table td > input[type=checkbox][disabled=disabled] {
cursor: default;
}
table.sp-modules-table td .button {
float: right;
margin: -1px -5px -1px 10px;
}
table.sp-modules-table [class^="sp-icon-"],
table.sp-modules-table [class*=" sp-icon-"],
table.sp-modules-table .dashicons {
position: relative;
top: 3px;
left: -0.5px;
line-height: 1;
}
table.sp-modules-table .sp-module-unavailable label {
color: #aaa;
cursor: text;
}
table.sp-modules-table .sp-module-unavailable label [class^="sp-icon-"],
table.sp-modules-table .sp-module-unavailable label [class*=" sp-icon-"],
table.sp-modules-table .sp-module-unavailable label .dashicons {
-moz-opacity: 0.8;
opacity: 0.8;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
}
#debug-report {
display: none;
margin: 10px 0;
@@ -555,8 +662,19 @@ table.sp_status_table td mark.yes {
}
/* Media Queries */
@media only screen and (max-width: 782px) {
@media only screen and (max-width: 850px) {
.sp-modules-wrapper {
margin-right: 0;
}
.sp-modules-main,
.sp-modules-sidebar {
margin-right: 0;
width: 100%;
}
}
@media only screen and (max-width: 782px) {
.fixed .column-sp_time,
.fixed .column-sp_team,
.fixed .column-sp_league,
@@ -570,8 +688,12 @@ table.sp_status_table td mark.yes {
.form-field .sp-location-picker {
width: 99%;
}
.form-field td .sp-location-picker {
width: 100%;
}
table.sp-modules-table td .button {
margin: -3px -7px -3px 10px;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -38,10 +38,13 @@ class SP_Admin_Post_Types {
include( 'post-types/class-sp-admin-cpt-metric.php' );
include( 'post-types/class-sp-admin-cpt-statistic.php' );
include( 'post-types/class-sp-admin-cpt-event.php' );
if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) )
include( 'post-types/class-sp-admin-cpt-calendar.php' );
include( 'post-types/class-sp-admin-cpt-team.php' );
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) )
include( 'post-types/class-sp-admin-cpt-table.php' );
include( 'post-types/class-sp-admin-cpt-player.php' );
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) )
include( 'post-types/class-sp-admin-cpt-list.php' );
include( 'post-types/class-sp-admin-cpt-staff.php' );
do_action( 'sportspress_include_post_type_handlers' );

View File

@@ -31,6 +31,7 @@ class SP_Admin_Settings {
include_once( 'class-sp-admin-sports.php' );
include_once( 'settings/class-sp-settings-page.php' );
$settings[] = include( 'settings/class-sp-settings-modules.php' );
$settings[] = include( 'settings/class-sp-settings-general.php' );
$settings[] = include( 'settings/class-sp-settings-events.php' );
$settings[] = include( 'settings/class-sp-settings-teams.php' );
@@ -119,7 +120,7 @@ class SP_Admin_Settings {
self::get_settings_pages();
// Get current tab/section
$current_tab = empty( $_GET['tab'] ) ? 'general' : sanitize_title( $_GET['tab'] );
$current_tab = empty( $_GET['tab'] ) ? 'modules' : sanitize_title( $_GET['tab'] );
$current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( $_REQUEST['section'] );
// Save settings if data has been posted

View File

@@ -196,7 +196,7 @@ class SP_Admin_Welcome {
<div class="sp-badge"><?php printf( __( 'Version %s', 'sportspress' ), SP()->version ); ?></div>
<p class="sportspress-actions">
<a href="<?php echo admin_url('admin.php?page=sportspress'); ?>" class="button button-primary"><?php _e( 'Settings', 'sportspress' ); ?></a>
<a href="<?php echo admin_url( add_query_arg( array( 'page' => 'sportspress', 'tab' => 'general' ), 'admin.php' ) ); ?>" class="button button-primary"><?php _e( 'Settings', 'sportspress' ); ?></a>
<a href="<?php echo esc_url( apply_filters( 'sportspress_docs_url', 'http://sportspresspro.com/docs/', 'sportspress' ) ); ?>" class="docs button button-primary"><?php _e( 'Docs', 'sportspress' ); ?></a>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://wordpress.org/plugins/sportspress" data-text="An open-source (free) #WordPress plugin that helps you build professional league websites." data-via="ThemeBoy" data-size="large" data-hashtags="SportsPress">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
@@ -264,7 +264,7 @@ class SP_Admin_Welcome {
endforeach;
echo $sport;
?>
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress' ), 'admin.php' ) ) ); ?>"><div class="dashicons dashicons-edit"></div><?php _e( 'Change', 'sportspress' ); ?></a>
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress', 'tab' => 'general' ), 'admin.php' ) ) ); ?>"><div class="dashicons dashicons-edit"></div><?php _e( 'Change', 'sportspress' ); ?></a>
<h4><?php _e( 'Next Steps', 'sportspress' ); ?></h4>
<p><?php _e( 'We&#8217;ve assembled some links to get you started:', 'sportspress' ); ?></p>
<div class="sportspress-steps">
@@ -275,7 +275,7 @@ class SP_Admin_Welcome {
</ul>
</div>
<div class="return-to-dashboard">
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to SportsPress Settings', 'sportspress' ); ?></a>
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress', 'tab' => 'general' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to SportsPress Settings', 'sportspress' ); ?></a>
</div>
<?php } else { ?>
<form method="post" id="mainform" action="" enctype="multipart/form-data">
@@ -329,7 +329,7 @@ class SP_Admin_Welcome {
</tbody>
</table>
<p class="submit sportspress-actions">
<input name="save" class="button-primary" type="submit" value="<?php _e( 'Save changes', 'sportspress' ); ?>" />
<input name="save" class="button-primary" type="submit" value="<?php _e( 'Save Changes', 'sportspress' ); ?>" />
<input type="hidden" name="subtab" id="last_tab" />
<?php wp_nonce_field( 'sportspress-settings' ); ?>
</p>

View File

@@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
* @version 1.3
* @version 1.6
*/
class SP_Admin {
@@ -32,7 +32,6 @@ class SP_Admin {
public function includes() {
// Functions
include_once( 'sp-admin-functions.php' );
// include_once( 'sp-meta-box-functions.php' );
// Classes
include_once( 'class-sp-admin-post-types.php' );
@@ -50,10 +49,6 @@ class SP_Admin {
if ( get_option( 'sportspress_rich_editing', true ) ):
include( 'class-sp-admin-editor.php' );
endif;
// Help
// if ( apply_filters( 'sportspress_enable_admin_help_tab', true ) )
// include( 'class-sp-admin-help.php' );
}
// Importers
@@ -71,12 +66,6 @@ class SP_Admin {
case 'dashboard' :
include( 'class-sp-admin-dashboard.php' );
break;
case 'users' :
case 'user' :
case 'profile' :
case 'user-edit' :
// include( 'class-sp-admin-profile.php' );
break;
}
}

View File

@@ -61,9 +61,13 @@ class SP_Admin_Meta_Boxes {
// Save Team Meta Boxes
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Details::save', 10, 2 );
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Columns::save', 20, 2 );
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Lists::save', 30, 2 );
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Tables::save', 40, 2 );
}
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Lists::save', 30, 2 );
}
// Save Table Meta Boxes
add_action( 'sportspress_process_sp_table_meta', 'SP_Meta_Box_Table_Details::save', 10, 2 );
@@ -123,14 +127,11 @@ class SP_Admin_Meta_Boxes {
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Event_Details::output', 'sp_event', 'side', 'default' );
add_meta_box( 'sp_teamdiv', __( 'Teams', 'sportspress' ), 'SP_Meta_Box_Event_Teams::output', 'sp_event', 'side', 'default' );
add_meta_box( 'sp_videodiv', __( 'Video', 'sportspress' ), 'SP_Meta_Box_Event_Video::output', 'sp_event', 'side', 'low' );
if ( sizeof( array_filter( sp_array_value( $post_meta, 'sp_team', array() ) ) ) ):
add_meta_box( 'sp_resultsdiv', __( 'Team Results', 'sportspress' ), 'SP_Meta_Box_Event_Results::output', 'sp_event', 'normal', 'high' );
endif;
if ( sizeof( array_filter( sp_array_value( $post_meta, 'sp_player', array() ) ) ) ):
add_meta_box( 'sp_performancediv', __( 'Player Performance', 'sportspress' ), 'SP_Meta_Box_Event_Performance::output', 'sp_event', 'normal', 'high' );
endif;
add_meta_box( 'sp_editordiv', __( 'Article', 'sportspress' ), 'SP_Meta_Box_Event_Editor::output', 'sp_event', 'normal', 'low' );
if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) {
// Calendars
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_Calendar_Shortcode::output', 'sp_calendar', 'side', 'default' );
if ( isset( $post ) && 'publish' == $post->post_status ):
@@ -140,21 +141,28 @@ class SP_Admin_Meta_Boxes {
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Calendar_Details::output', 'sp_calendar', 'side', 'default' );
add_meta_box( 'sp_datadiv', __( 'Events', 'sportspress' ), 'SP_Meta_Box_Calendar_Data::output', 'sp_calendar', 'normal', 'high' );
add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_Calendar_Editor::output', 'sp_calendar', 'normal', 'low' );
}
// Teams
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Team_Details::output', 'sp_team', 'side', 'default' );
if ( isset( $post ) && isset( $post->ID ) ):
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
add_meta_box( 'sp_listsdiv', __( 'Player Lists', 'sportspress' ), 'SP_Meta_Box_Team_Lists::output', 'sp_team', 'normal', 'high' );
}
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
add_meta_box( 'sp_tablesdiv', __( 'League Tables', 'sportspress' ), 'SP_Meta_Box_Team_Tables::output', 'sp_team', 'normal', 'high' );
add_meta_box( 'sp_columnssdiv', __( 'Table Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::output', 'sp_team', 'normal', 'high' );
}
endif;
add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Team_Editor::output', 'sp_team', 'normal', 'low' );
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
// Tables
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_Table_Shortcode::output', 'sp_table', 'side', 'default' );
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Table_Details::output', 'sp_table', 'side', 'default' );
add_meta_box( 'sp_datadiv', __( 'League Table', 'sportspress' ), 'SP_Meta_Box_Table_Data::output', 'sp_table', 'normal', 'high' );
add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_Table_Editor::output', 'sp_table', 'normal', 'low' );
}
// Players
add_meta_box( 'sp_shortcodediv', __( 'Shortcodes', 'sportspress' ), 'SP_Meta_Box_Player_Shortcode::output', 'sp_player', 'side', 'default' );
@@ -166,6 +174,7 @@ class SP_Admin_Meta_Boxes {
endif;
add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Player_Editor::output', 'sp_player', 'normal', 'low' );
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
// Lists
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_List_Shortcode::output', 'sp_list', 'side', 'default' );
add_meta_box( 'sp_formatdiv', __( 'Layout', 'sportspress' ), 'SP_Meta_Box_List_Format::output', 'sp_list', 'side', 'default' );
@@ -173,6 +182,7 @@ class SP_Admin_Meta_Boxes {
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_List_Details::output', 'sp_list', 'side', 'default' );
add_meta_box( 'sp_datadiv', __( 'Player List', 'sportspress' ), 'SP_Meta_Box_List_Data::output', 'sp_list', 'normal', 'high' );
add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_List_Editor::output', 'sp_list', 'normal', 'low' );
}
// Staff
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_Staff_Shortcode::output', 'sp_staff', 'side', 'default' );

View File

@@ -1,4 +1,5 @@
<div class="wrap sportspress">
<h2><?php echo apply_filters( 'sportspress_logo', '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . '/assets/images/modules/sportspress' . ( class_exists( 'SportsPress_Pro' ) ? '-pro' : '' ) . '.png" alt="' . __( 'SportsPress', 'sportspress' ) . '">' ); ?></h2>
<form method="post" id="mainform" action="" enctype="multipart/form-data">
<h2 class="nav-tab-wrapper sp-nav-tab-wrapper">
<?php foreach ( $tabs as $name => $label ): ?><a href="<?php echo admin_url( 'admin.php?page=sportspress&tab=' . $name ); ?>" class="nav-tab <?php echo ( $current_tab == $name ? 'nav-tab-active' : '' ); ?>"><?php echo $label; ?></a><?php endforeach; ?>
@@ -11,7 +12,7 @@
?>
<p class="submit">
<?php if ( ! isset( $GLOBALS['hide_save_button'] ) ) : ?>
<input name="save" class="button-primary" type="submit" value="<?php _e( 'Save changes', 'sportspress' ); ?>" />
<input name="save" class="button-primary" type="submit" value="<?php _e( 'Save Changes', 'sportspress' ); ?>" />
<?php endif; ?>
<input type="hidden" name="subtab" id="last_tab" />
<?php wp_nonce_field( 'sportspress-settings' ); ?>

View File

@@ -0,0 +1,103 @@
<?php
/**
* SportsPress modules
*
* The SportsPress modules class stores available modules.
*
* @class SP_Modules
* @version 1.6
* @package SportsPress/Classes
* @category Class
* @author ThemeBoy
*/
class SP_Modules {
/** @var array Array of modules */
public $data;
/**
* Constructor for the modules class - defines all default modules.
*
* @access public
* @return void
*/
public function __construct() {
$this->data = apply_filters( 'sportspress_modules', array(
'event' => array(
'calendars' => array(
'label' => __( 'Calendars', 'sportspress' ),
'icon' => 'sp-icon-calendar',
),
'tournaments' => array(
'label' => __( 'Tournaments', 'sportspress' ),
'class' => 'SportsPress_Tournaments',
'icon' => 'sp-icon-trophy',
),
),
'team' => array(
'league_tables' => array(
'label' => __( 'League Tables', 'sportspress' ),
'icon' => 'sp-icon-chart',
),
'team_colors' => array(
'label' => __( 'Team Colors', 'sportspress' ),
'class' => 'SportsPress_Team_Colors',
'icon' => 'sp-icon-color',
),
),
'player' => array(
'player_lists' => array(
'label' => __( 'Player Lists', 'sportspress' ),
'icon' => 'sp-icon-list',
),
'player_birthdays' => array(
'label' => __( 'Birthdays', 'sportspress' ),
'class' => 'SportsPress_Birthdays',
'action' => __( 'Review on WP.org', 'sportspress' ),
'link' => 'http://wordpress.org/support/view/plugin-reviews/sportspress#postform',
'icon' => 'sp-icon-cake',
),
),
'staff' => array(
'staff_directories' => array(
'label' => __( 'Directories', 'sportspress' ),
'class' => 'SportsPress_Staff_Directories',
'icon' => 'sp-icon-archive',
),
),
'other' => array(
'twitter' => array(
'label' => __( 'Twitter', 'sportspress' ),
'class' => 'SportsPress_Twitter',
'action' => __( 'Tweet #SportsPress', 'sportspress' ),
'link' => 'http://ctt.ec/d0sCF',
'icon' => 'dashicons dashicons-twitter',
),
'branding' => array(
'label' => __( 'Branding', 'sportspress' ),
'class' => 'SportsPress_Branding',
'icon' => 'sp-icon-sportspress',
),
'league_menu' => array(
'label' => __( 'League Menu', 'sportspress' ),
'class' => 'SportsPress_League_Menu',
'icon' => 'sp-icon-menu',
),
'sponsors' => array(
'label' => __( 'Sponsors', 'sportspress' ),
'class' => 'SportsPress_Sponsors',
'icon' => 'sp-icon-megaphone',
),
'multisite' => array(
'label' => __( 'Multisite', 'sportspress' ),
'class' => 'SportsPress_Multisite',
'icon' => 'sp-icon-globe',
),
),
));
}
public function __set( $key, $value ){
$this->data[ $key ] = $value;
}
}

View File

@@ -396,6 +396,7 @@ class SP_Post_types {
register_post_type( 'sp_event', apply_filters( 'sportspress_register_post_type_event', $args ) );
if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) {
register_post_type( 'sp_calendar',
apply_filters( 'sportspress_register_post_type_calendar',
array(
@@ -426,6 +427,7 @@ class SP_Post_types {
)
)
);
}
register_post_type( 'sp_team',
apply_filters( 'sportspress_register_post_type_team',
@@ -457,6 +459,7 @@ class SP_Post_types {
)
);
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
register_post_type( 'sp_table',
apply_filters( 'sportspress_register_post_type_table',
array(
@@ -487,6 +490,7 @@ class SP_Post_types {
)
)
);
}
register_post_type( 'sp_player',
apply_filters( 'sportspress_register_post_type_player',
@@ -518,6 +522,7 @@ class SP_Post_types {
)
);
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
register_post_type( 'sp_list',
apply_filters( 'sportspress_register_post_type_list',
array(
@@ -548,6 +553,7 @@ class SP_Post_types {
)
)
);
}
register_post_type( 'sp_staff',
apply_filters( 'sportspress_register_post_type_staff',

View File

@@ -20,16 +20,31 @@ class SP_Shortcodes {
'event_details' => __CLASS__ . '::event_details',
'event_performance' => __CLASS__ . '::event_performance',
'countdown' => __CLASS__ . '::countdown',
'player_details' => __CLASS__ . '::player_details',
'player_statistics' => __CLASS__ . '::player_statistics',
'staff' => __CLASS__ . '::staff',
);
if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) {
$shortcodes = array_merge( $shortcodes, array(
'event_calendar' => __CLASS__ . '::event_calendar',
'event_list' => __CLASS__ . '::event_list',
'event_blocks' => __CLASS__ . '::event_blocks',
));
}
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
$shortcodes = array_merge( $shortcodes, array(
'league_table' => __CLASS__ . '::league_table',
'player_details' => __CLASS__ . '::player_details',
'player_statistics' => __CLASS__ . '::player_statistics',
));
}
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
$shortcodes = array_merge( $shortcodes, array(
'player_list' => __CLASS__ . '::player_list',
'player_gallery' => __CLASS__ . '::player_gallery',
'staff' => __CLASS__ . '::staff',
);
));
}
foreach ( $shortcodes as $shortcode => $function ) {
add_shortcode( $shortcode, $function );

View File

@@ -7,7 +7,7 @@
* @author ThemeBoy
* @category Core
* @package SportsPress/Functions
* @version 1.5
* @version 1.6
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -1188,7 +1188,7 @@ function sp_get_text_options() {
function sp_review_link() {
?>
<p>
<a href="http://wordpress.org/support/view/plugin-reviews/sportspress?rate=5#postform">
<a href="http://wordpress.org/support/view/plugin-reviews/sportspress#postform">
<?php _e( 'Love SportsPress? Help spread the word by rating us 5★ on WordPress.org', 'sportspress' ); ?>
</a>
</p>

View File

@@ -32,8 +32,8 @@ add_action( 'get_the_generator_xhtml', 'sp_generator_tag', 10, 2 );
* @see sportspress_output_event_performance()
*/
add_action( 'sportspress_single_event_content', 'sportspress_output_event_logos', 0 );
add_action( 'sportspress_single_event_content', 'sportspress_output_event_video', 10 );
add_action( 'sportspress_single_event_content', 'sportspress_output_event_results', 20 );
add_action( 'sportspress_single_event_content', 'sportspress_output_event_video', 10 );
add_action( 'sportspress_single_event_content', 'sportspress_output_event_details', 30 );
add_action( 'sportspress_single_event_content', 'sportspress_output_event_venue', 40 );
add_action( 'sportspress_single_event_content', 'sportspress_output_event_performance', 50 );
@@ -55,8 +55,12 @@ add_action( 'sportspress_single_calendar_content', 'sportspress_output_calendar'
*/
add_action( 'sportspress_single_team_content', 'sportspress_output_team_logo', 0 );
add_action( 'sportspress_single_team_content', 'sportspress_output_team_details', 10 );
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
add_action( 'sportspress_single_team_content', 'sportspress_output_team_lists', 20 );
}
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
add_action( 'sportspress_single_team_content', 'sportspress_output_team_tables', 30 );
}
/**
* After Single Team

View File

@@ -129,7 +129,6 @@ To keep up with the latest updates and new features, be sure to do the following
* Subscribe to our [YouTube channel](https://www.youtube.com/user/themeboyteam).
* Follow ThemeBoy on [Facebook](https://facebook.com/themeboy) & [Twitter](http://twitter.com/themeboy).
= Please Rate, Vote, and Enjoy! =
Your feedback is much appreciated and makes all the difference in improving SportsPress.

View File

@@ -41,6 +41,11 @@ final class SportsPress {
*/
protected static $_instance = null;
/**
* @var SP_Modules $modules
*/
public $modules = null;
/**
* @var SP_Countries $countries
*/
@@ -212,6 +217,7 @@ final class SportsPress {
include_once( 'includes/abstracts/abstract-sp-custom-post.php' ); // Custom posts
// Classes (used on all pages)
include_once( 'includes/class-sp-modules.php' ); // Defines available modules
include_once( 'includes/class-sp-countries.php' ); // Defines continents and countries
include_once( 'includes/class-sp-formats.php' ); // Defines custom post type formats
include_once( 'includes/class-sp-feeds.php' ); // Adds feeds
@@ -247,12 +253,18 @@ final class SportsPress {
*/
public function include_widgets() {
include_once( 'includes/widgets/class-sp-widget-countdown.php' );
if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) {
include_once( 'includes/widgets/class-sp-widget-event-calendar.php' );
include_once( 'includes/widgets/class-sp-widget-event-list.php' );
include_once( 'includes/widgets/class-sp-widget-event-blocks.php' );
}
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
include_once( 'includes/widgets/class-sp-widget-league-table.php' );
}
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
include_once( 'includes/widgets/class-sp-widget-player-list.php' );
include_once( 'includes/widgets/class-sp-widget-player-gallery.php' );
}
include_once( 'includes/widgets/class-sp-widget-staff.php' );
do_action( 'sportspress_widgets' );
@@ -269,6 +281,7 @@ final class SportsPress {
$this->load_plugin_textdomain();
// Load class instances
$this->modules = new SP_Modules(); // Modules class
$this->countries = new SP_Countries(); // Countries class
$this->formats = new SP_Formats(); // Formats class
$this->feeds = new SP_Feeds(); // Feeds class
@@ -351,6 +364,6 @@ function SP() {
return SportsPress::instance();
}
SP();
endif;
SP();