Add modules tab to settings page
This commit is contained in:
@@ -199,6 +199,7 @@
|
|||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sportspress .submit,
|
||||||
.sp-data-table-container {
|
.sp-data-table-container {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
@@ -486,6 +487,112 @@ table.widefat.sp-sortable-table tbody tr .icon {
|
|||||||
border-left-color: #464646;
|
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 {
|
#debug-report {
|
||||||
display: none;
|
display: none;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
@@ -555,8 +662,19 @@ table.sp_status_table td mark.yes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Media Queries */
|
/* 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_time,
|
||||||
.fixed .column-sp_team,
|
.fixed .column-sp_team,
|
||||||
.fixed .column-sp_league,
|
.fixed .column-sp_league,
|
||||||
@@ -570,8 +688,12 @@ table.sp_status_table td mark.yes {
|
|||||||
.form-field .sp-location-picker {
|
.form-field .sp-location-picker {
|
||||||
width: 99%;
|
width: 99%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-field td .sp-location-picker {
|
.form-field td .sp-location-picker {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.sp-modules-table td .button {
|
||||||
|
margin: -3px -7px -3px 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
BIN
assets/images/modules/sportspress-pro-sidebar.png
Normal file
BIN
assets/images/modules/sportspress-pro-sidebar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
assets/images/modules/sportspress-pro.png
Normal file
BIN
assets/images/modules/sportspress-pro.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
BIN
assets/images/modules/sportspress-tv-sidebar.png
Normal file
BIN
assets/images/modules/sportspress-tv-sidebar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
assets/images/modules/sportspress.png
Normal file
BIN
assets/images/modules/sportspress.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
@@ -38,11 +38,14 @@ class SP_Admin_Post_Types {
|
|||||||
include( 'post-types/class-sp-admin-cpt-metric.php' );
|
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-statistic.php' );
|
||||||
include( 'post-types/class-sp-admin-cpt-event.php' );
|
include( 'post-types/class-sp-admin-cpt-event.php' );
|
||||||
include( 'post-types/class-sp-admin-cpt-calendar.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' );
|
include( 'post-types/class-sp-admin-cpt-team.php' );
|
||||||
include( 'post-types/class-sp-admin-cpt-table.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' );
|
include( 'post-types/class-sp-admin-cpt-player.php' );
|
||||||
include( 'post-types/class-sp-admin-cpt-list.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' );
|
include( 'post-types/class-sp-admin-cpt-staff.php' );
|
||||||
do_action( 'sportspress_include_post_type_handlers' );
|
do_action( 'sportspress_include_post_type_handlers' );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ class SP_Admin_Settings {
|
|||||||
include_once( 'class-sp-admin-sports.php' );
|
include_once( 'class-sp-admin-sports.php' );
|
||||||
include_once( 'settings/class-sp-settings-page.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-general.php' );
|
||||||
$settings[] = include( 'settings/class-sp-settings-events.php' );
|
$settings[] = include( 'settings/class-sp-settings-events.php' );
|
||||||
$settings[] = include( 'settings/class-sp-settings-teams.php' );
|
$settings[] = include( 'settings/class-sp-settings-teams.php' );
|
||||||
@@ -119,7 +120,7 @@ class SP_Admin_Settings {
|
|||||||
self::get_settings_pages();
|
self::get_settings_pages();
|
||||||
|
|
||||||
// Get current tab/section
|
// 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'] );
|
$current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( $_REQUEST['section'] );
|
||||||
|
|
||||||
// Save settings if data has been posted
|
// Save settings if data has been posted
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ class SP_Admin_Welcome {
|
|||||||
<div class="sp-badge"><?php printf( __( 'Version %s', 'sportspress' ), SP()->version ); ?></div>
|
<div class="sp-badge"><?php printf( __( 'Version %s', 'sportspress' ), SP()->version ); ?></div>
|
||||||
|
|
||||||
<p class="sportspress-actions">
|
<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="<?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>
|
<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>
|
<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;
|
endforeach;
|
||||||
echo $sport;
|
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>
|
<h4><?php _e( 'Next Steps', 'sportspress' ); ?></h4>
|
||||||
<p><?php _e( 'We’ve assembled some links to get you started:', 'sportspress' ); ?></p>
|
<p><?php _e( 'We’ve assembled some links to get you started:', 'sportspress' ); ?></p>
|
||||||
<div class="sportspress-steps">
|
<div class="sportspress-steps">
|
||||||
@@ -275,7 +275,7 @@ class SP_Admin_Welcome {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="return-to-dashboard">
|
<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>
|
</div>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<form method="post" id="mainform" action="" enctype="multipart/form-data">
|
<form method="post" id="mainform" action="" enctype="multipart/form-data">
|
||||||
@@ -329,7 +329,7 @@ class SP_Admin_Welcome {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p class="submit sportspress-actions">
|
<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" />
|
<input type="hidden" name="subtab" id="last_tab" />
|
||||||
<?php wp_nonce_field( 'sportspress-settings' ); ?>
|
<?php wp_nonce_field( 'sportspress-settings' ); ?>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Admin
|
* @category Admin
|
||||||
* @package SportsPress/Admin
|
* @package SportsPress/Admin
|
||||||
* @version 1.3
|
* @version 1.6
|
||||||
*/
|
*/
|
||||||
class SP_Admin {
|
class SP_Admin {
|
||||||
|
|
||||||
@@ -32,7 +32,6 @@ class SP_Admin {
|
|||||||
public function includes() {
|
public function includes() {
|
||||||
// Functions
|
// Functions
|
||||||
include_once( 'sp-admin-functions.php' );
|
include_once( 'sp-admin-functions.php' );
|
||||||
// include_once( 'sp-meta-box-functions.php' );
|
|
||||||
|
|
||||||
// Classes
|
// Classes
|
||||||
include_once( 'class-sp-admin-post-types.php' );
|
include_once( 'class-sp-admin-post-types.php' );
|
||||||
@@ -50,10 +49,6 @@ class SP_Admin {
|
|||||||
if ( get_option( 'sportspress_rich_editing', true ) ):
|
if ( get_option( 'sportspress_rich_editing', true ) ):
|
||||||
include( 'class-sp-admin-editor.php' );
|
include( 'class-sp-admin-editor.php' );
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
// Help
|
|
||||||
// if ( apply_filters( 'sportspress_enable_admin_help_tab', true ) )
|
|
||||||
// include( 'class-sp-admin-help.php' );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Importers
|
// Importers
|
||||||
@@ -70,13 +65,7 @@ class SP_Admin {
|
|||||||
switch ( $screen->id ) {
|
switch ( $screen->id ) {
|
||||||
case 'dashboard' :
|
case 'dashboard' :
|
||||||
include( 'class-sp-admin-dashboard.php' );
|
include( 'class-sp-admin-dashboard.php' );
|
||||||
break;
|
break;
|
||||||
case 'users' :
|
|
||||||
case 'user' :
|
|
||||||
case 'profile' :
|
|
||||||
case 'user-edit' :
|
|
||||||
// include( 'class-sp-admin-profile.php' );
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,9 +61,13 @@ class SP_Admin_Meta_Boxes {
|
|||||||
|
|
||||||
// Save Team Meta Boxes
|
// Save Team Meta Boxes
|
||||||
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Details::save', 10, 2 );
|
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Details::save', 10, 2 );
|
||||||
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Columns::save', 20, 2 );
|
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
|
||||||
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_Columns::save', 20, 2 );
|
||||||
add_action( 'sportspress_process_sp_team_meta', 'SP_Meta_Box_Team_Tables::save', 40, 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
|
// Save Table Meta Boxes
|
||||||
add_action( 'sportspress_process_sp_table_meta', 'SP_Meta_Box_Table_Details::save', 10, 2 );
|
add_action( 'sportspress_process_sp_table_meta', 'SP_Meta_Box_Table_Details::save', 10, 2 );
|
||||||
@@ -123,38 +127,42 @@ 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_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_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' );
|
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' );
|
||||||
add_meta_box( 'sp_resultsdiv', __( 'Team Results', 'sportspress' ), 'SP_Meta_Box_Event_Results::output', 'sp_event', 'normal', 'high' );
|
add_meta_box( 'sp_performancediv', __( 'Player Performance', 'sportspress' ), 'SP_Meta_Box_Event_Performance::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' );
|
add_meta_box( 'sp_editordiv', __( 'Article', 'sportspress' ), 'SP_Meta_Box_Event_Editor::output', 'sp_event', 'normal', 'low' );
|
||||||
|
|
||||||
// Calendars
|
if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) {
|
||||||
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_Calendar_Shortcode::output', 'sp_calendar', 'side', 'default' );
|
// Calendars
|
||||||
if ( isset( $post ) && 'publish' == $post->post_status ):
|
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_Calendar_Shortcode::output', 'sp_calendar', 'side', 'default' );
|
||||||
add_meta_box( 'sp_feedsdiv', __( 'Feeds', 'sportspress' ), 'SP_Meta_Box_Calendar_Feeds::output', 'sp_calendar', 'side', 'default' );
|
if ( isset( $post ) && 'publish' == $post->post_status ):
|
||||||
endif;
|
add_meta_box( 'sp_feedsdiv', __( 'Feeds', 'sportspress' ), 'SP_Meta_Box_Calendar_Feeds::output', 'sp_calendar', 'side', 'default' );
|
||||||
add_meta_box( 'sp_formatdiv', __( 'Layout', 'sportspress' ), 'SP_Meta_Box_Calendar_Format::output', 'sp_calendar', 'side', 'default' );
|
endif;
|
||||||
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Calendar_Details::output', 'sp_calendar', 'side', 'default' );
|
add_meta_box( 'sp_formatdiv', __( 'Layout', 'sportspress' ), 'SP_Meta_Box_Calendar_Format::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_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Calendar_Details::output', 'sp_calendar', 'side', 'default' );
|
||||||
add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_Calendar_Editor::output', 'sp_calendar', 'normal', 'low' );
|
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
|
// Teams
|
||||||
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Team_Details::output', 'sp_team', 'side', 'default' );
|
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Team_Details::output', 'sp_team', 'side', 'default' );
|
||||||
if ( isset( $post ) && isset( $post->ID ) ):
|
if ( isset( $post ) && isset( $post->ID ) ):
|
||||||
add_meta_box( 'sp_listsdiv', __( 'Player Lists', 'sportspress' ), 'SP_Meta_Box_Team_Lists::output', 'sp_team', 'normal', 'high' );
|
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
|
||||||
add_meta_box( 'sp_tablesdiv', __( 'League Tables', 'sportspress' ), 'SP_Meta_Box_Team_Tables::output', 'sp_team', 'normal', 'high' );
|
add_meta_box( 'sp_listsdiv', __( 'Player Lists', 'sportspress' ), 'SP_Meta_Box_Team_Lists::output', 'sp_team', 'normal', 'high' );
|
||||||
add_meta_box( 'sp_columnssdiv', __( 'Table Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::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;
|
endif;
|
||||||
add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Team_Editor::output', 'sp_team', 'normal', 'low' );
|
add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Team_Editor::output', 'sp_team', 'normal', 'low' );
|
||||||
|
|
||||||
// Tables
|
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
|
||||||
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_Table_Shortcode::output', 'sp_table', 'side', 'default' );
|
// Tables
|
||||||
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Table_Details::output', 'sp_table', 'side', 'default' );
|
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_Table_Shortcode::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_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Table_Details::output', 'sp_table', 'side', 'default' );
|
||||||
add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_Table_Editor::output', 'sp_table', 'normal', 'low' );
|
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
|
// Players
|
||||||
add_meta_box( 'sp_shortcodediv', __( 'Shortcodes', 'sportspress' ), 'SP_Meta_Box_Player_Shortcode::output', 'sp_player', 'side', 'default' );
|
add_meta_box( 'sp_shortcodediv', __( 'Shortcodes', 'sportspress' ), 'SP_Meta_Box_Player_Shortcode::output', 'sp_player', 'side', 'default' );
|
||||||
@@ -166,13 +174,15 @@ class SP_Admin_Meta_Boxes {
|
|||||||
endif;
|
endif;
|
||||||
add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Player_Editor::output', 'sp_player', 'normal', 'low' );
|
add_meta_box( 'sp_editordiv', __( 'Profile', 'sportspress' ), 'SP_Meta_Box_Player_Editor::output', 'sp_player', 'normal', 'low' );
|
||||||
|
|
||||||
// Lists
|
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
|
||||||
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_List_Shortcode::output', 'sp_list', 'side', 'default' );
|
// Lists
|
||||||
add_meta_box( 'sp_formatdiv', __( 'Layout', 'sportspress' ), 'SP_Meta_Box_List_Format::output', 'sp_list', 'side', 'default' );
|
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_List_Shortcode::output', 'sp_list', 'side', 'default' );
|
||||||
add_meta_box( 'sp_columnsdiv', __( 'Columns', 'sportspress' ), 'SP_Meta_Box_List_Columns::output', 'sp_list', 'side', 'default' );
|
add_meta_box( 'sp_formatdiv', __( 'Layout', 'sportspress' ), 'SP_Meta_Box_List_Format::output', 'sp_list', 'side', 'default' );
|
||||||
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_List_Details::output', 'sp_list', 'side', 'default' );
|
add_meta_box( 'sp_columnsdiv', __( 'Columns', 'sportspress' ), 'SP_Meta_Box_List_Columns::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_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_List_Details::output', 'sp_list', 'side', 'default' );
|
||||||
add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_List_Editor::output', 'sp_list', 'normal', 'low' );
|
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
|
// Staff
|
||||||
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_Staff_Shortcode::output', 'sp_staff', 'side', 'default' );
|
add_meta_box( 'sp_shortcodediv', __( 'Shortcode', 'sportspress' ), 'SP_Meta_Box_Staff_Shortcode::output', 'sp_staff', 'side', 'default' );
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<div class="wrap sportspress">
|
<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">
|
<form method="post" id="mainform" action="" enctype="multipart/form-data">
|
||||||
<h2 class="nav-tab-wrapper sp-nav-tab-wrapper">
|
<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; ?>
|
<?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">
|
<p class="submit">
|
||||||
<?php if ( ! isset( $GLOBALS['hide_save_button'] ) ) : ?>
|
<?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; ?>
|
<?php endif; ?>
|
||||||
<input type="hidden" name="subtab" id="last_tab" />
|
<input type="hidden" name="subtab" id="last_tab" />
|
||||||
<?php wp_nonce_field( 'sportspress-settings' ); ?>
|
<?php wp_nonce_field( 'sportspress-settings' ); ?>
|
||||||
|
|||||||
103
includes/class-sp-modules.php
Normal file
103
includes/class-sp-modules.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -396,36 +396,38 @@ class SP_Post_types {
|
|||||||
|
|
||||||
register_post_type( 'sp_event', apply_filters( 'sportspress_register_post_type_event', $args ) );
|
register_post_type( 'sp_event', apply_filters( 'sportspress_register_post_type_event', $args ) );
|
||||||
|
|
||||||
register_post_type( 'sp_calendar',
|
if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) {
|
||||||
apply_filters( 'sportspress_register_post_type_calendar',
|
register_post_type( 'sp_calendar',
|
||||||
array(
|
apply_filters( 'sportspress_register_post_type_calendar',
|
||||||
'labels' => array(
|
array(
|
||||||
'name' => __( 'Calendars', 'sportspress' ),
|
'labels' => array(
|
||||||
'singular_name' => __( 'Calendar', 'sportspress' ),
|
'name' => __( 'Calendars', 'sportspress' ),
|
||||||
'add_new_item' => __( 'Add New Calendar', 'sportspress' ),
|
'singular_name' => __( 'Calendar', 'sportspress' ),
|
||||||
'edit_item' => __( 'Edit Calendar', 'sportspress' ),
|
'add_new_item' => __( 'Add New Calendar', 'sportspress' ),
|
||||||
'new_item' => __( 'New', 'sportspress' ),
|
'edit_item' => __( 'Edit Calendar', 'sportspress' ),
|
||||||
'view_item' => __( 'View Calendar', 'sportspress' ),
|
'new_item' => __( 'New', 'sportspress' ),
|
||||||
'search_items' => __( 'Search', 'sportspress' ),
|
'view_item' => __( 'View Calendar', 'sportspress' ),
|
||||||
'not_found' => __( 'No results found.', 'sportspress' ),
|
'search_items' => __( 'Search', 'sportspress' ),
|
||||||
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
'not_found' => __( 'No results found.', 'sportspress' ),
|
||||||
),
|
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
||||||
'public' => true,
|
),
|
||||||
'show_ui' => true,
|
'public' => true,
|
||||||
'capability_type' => 'sp_calendar',
|
'show_ui' => true,
|
||||||
'map_meta_cap' => true,
|
'capability_type' => 'sp_calendar',
|
||||||
'publicly_queryable' => true,
|
'map_meta_cap' => true,
|
||||||
'exclude_from_search' => false,
|
'publicly_queryable' => true,
|
||||||
'hierarchical' => false,
|
'exclude_from_search' => false,
|
||||||
'rewrite' => array( 'slug' => get_option( 'sportspress_calendar_slug', 'calendar' ) ),
|
'hierarchical' => false,
|
||||||
'supports' => array( 'title', 'author', 'thumbnail' ),
|
'rewrite' => array( 'slug' => get_option( 'sportspress_calendar_slug', 'calendar' ) ),
|
||||||
'has_archive' => false,
|
'supports' => array( 'title', 'author', 'thumbnail' ),
|
||||||
'show_in_nav_menus' => true,
|
'has_archive' => false,
|
||||||
'show_in_menu' => 'edit.php?post_type=sp_event',
|
'show_in_nav_menus' => true,
|
||||||
'show_in_admin_bar' => true,
|
'show_in_menu' => 'edit.php?post_type=sp_event',
|
||||||
|
'show_in_admin_bar' => true,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
register_post_type( 'sp_team',
|
register_post_type( 'sp_team',
|
||||||
apply_filters( 'sportspress_register_post_type_team',
|
apply_filters( 'sportspress_register_post_type_team',
|
||||||
@@ -457,36 +459,38 @@ class SP_Post_types {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
register_post_type( 'sp_table',
|
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
|
||||||
apply_filters( 'sportspress_register_post_type_table',
|
register_post_type( 'sp_table',
|
||||||
array(
|
apply_filters( 'sportspress_register_post_type_table',
|
||||||
'labels' => array(
|
array(
|
||||||
'name' => __( 'League Tables', 'sportspress' ),
|
'labels' => array(
|
||||||
'singular_name' => __( 'League Table', 'sportspress' ),
|
'name' => __( 'League Tables', 'sportspress' ),
|
||||||
'add_new_item' => __( 'Add New League Table', 'sportspress' ),
|
'singular_name' => __( 'League Table', 'sportspress' ),
|
||||||
'edit_item' => __( 'Edit League Table', 'sportspress' ),
|
'add_new_item' => __( 'Add New League Table', 'sportspress' ),
|
||||||
'new_item' => __( 'New', 'sportspress' ),
|
'edit_item' => __( 'Edit League Table', 'sportspress' ),
|
||||||
'view_item' => __( 'View League Table', 'sportspress' ),
|
'new_item' => __( 'New', 'sportspress' ),
|
||||||
'search_items' => __( 'Search', 'sportspress' ),
|
'view_item' => __( 'View League Table', 'sportspress' ),
|
||||||
'not_found' => __( 'No results found.', 'sportspress' ),
|
'search_items' => __( 'Search', 'sportspress' ),
|
||||||
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
'not_found' => __( 'No results found.', 'sportspress' ),
|
||||||
),
|
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
||||||
'public' => true,
|
),
|
||||||
'show_ui' => true,
|
'public' => true,
|
||||||
'capability_type' => 'sp_table',
|
'show_ui' => true,
|
||||||
'map_meta_cap' => true,
|
'capability_type' => 'sp_table',
|
||||||
'publicly_queryable' => true,
|
'map_meta_cap' => true,
|
||||||
'exclude_from_search' => false,
|
'publicly_queryable' => true,
|
||||||
'hierarchical' => false,
|
'exclude_from_search' => false,
|
||||||
'rewrite' => array( 'slug' => get_option( 'sportspress_table_slug', 'table' ) ),
|
'hierarchical' => false,
|
||||||
'supports' => array( 'title', 'page-attributes', 'thumbnail' ),
|
'rewrite' => array( 'slug' => get_option( 'sportspress_table_slug', 'table' ) ),
|
||||||
'has_archive' => false,
|
'supports' => array( 'title', 'page-attributes', 'thumbnail' ),
|
||||||
'show_in_nav_menus' => true,
|
'has_archive' => false,
|
||||||
'show_in_menu' => 'edit.php?post_type=sp_team',
|
'show_in_nav_menus' => true,
|
||||||
'show_in_admin_bar' => true,
|
'show_in_menu' => 'edit.php?post_type=sp_team',
|
||||||
|
'show_in_admin_bar' => true,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
register_post_type( 'sp_player',
|
register_post_type( 'sp_player',
|
||||||
apply_filters( 'sportspress_register_post_type_player',
|
apply_filters( 'sportspress_register_post_type_player',
|
||||||
@@ -518,36 +522,38 @@ class SP_Post_types {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
register_post_type( 'sp_list',
|
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
|
||||||
apply_filters( 'sportspress_register_post_type_list',
|
register_post_type( 'sp_list',
|
||||||
array(
|
apply_filters( 'sportspress_register_post_type_list',
|
||||||
'labels' => array(
|
array(
|
||||||
'name' => __( 'Player Lists', 'sportspress' ),
|
'labels' => array(
|
||||||
'singular_name' => __( 'Player List', 'sportspress' ),
|
'name' => __( 'Player Lists', 'sportspress' ),
|
||||||
'add_new_item' => __( 'Add New Player List', 'sportspress' ),
|
'singular_name' => __( 'Player List', 'sportspress' ),
|
||||||
'edit_item' => __( 'Edit Player List', 'sportspress' ),
|
'add_new_item' => __( 'Add New Player List', 'sportspress' ),
|
||||||
'new_item' => __( 'New', 'sportspress' ),
|
'edit_item' => __( 'Edit Player List', 'sportspress' ),
|
||||||
'view_item' => __( 'View Player List', 'sportspress' ),
|
'new_item' => __( 'New', 'sportspress' ),
|
||||||
'search_items' => __( 'Search', 'sportspress' ),
|
'view_item' => __( 'View Player List', 'sportspress' ),
|
||||||
'not_found' => __( 'No results found.', 'sportspress' ),
|
'search_items' => __( 'Search', 'sportspress' ),
|
||||||
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
'not_found' => __( 'No results found.', 'sportspress' ),
|
||||||
),
|
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
||||||
'public' => true,
|
),
|
||||||
'show_ui' => true,
|
'public' => true,
|
||||||
'capability_type' => 'sp_list',
|
'show_ui' => true,
|
||||||
'map_meta_cap' => true,
|
'capability_type' => 'sp_list',
|
||||||
'publicly_queryable' => true,
|
'map_meta_cap' => true,
|
||||||
'exclude_from_search' => false,
|
'publicly_queryable' => true,
|
||||||
'hierarchical' => false,
|
'exclude_from_search' => false,
|
||||||
'rewrite' => array( 'slug' => get_option( 'sportspress_list_slug', 'list' ) ),
|
'hierarchical' => false,
|
||||||
'supports' => array( 'title', 'page-attributes', 'author', 'thumbnail' ),
|
'rewrite' => array( 'slug' => get_option( 'sportspress_list_slug', 'list' ) ),
|
||||||
'has_archive' => false,
|
'supports' => array( 'title', 'page-attributes', 'author', 'thumbnail' ),
|
||||||
'show_in_nav_menus' => true,
|
'has_archive' => false,
|
||||||
'show_in_menu' => 'edit.php?post_type=sp_player',
|
'show_in_nav_menus' => true,
|
||||||
'show_in_admin_bar' => true,
|
'show_in_menu' => 'edit.php?post_type=sp_player',
|
||||||
|
'show_in_admin_bar' => true,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
register_post_type( 'sp_staff',
|
register_post_type( 'sp_staff',
|
||||||
apply_filters( 'sportspress_register_post_type_staff',
|
apply_filters( 'sportspress_register_post_type_staff',
|
||||||
|
|||||||
@@ -20,17 +20,32 @@ class SP_Shortcodes {
|
|||||||
'event_details' => __CLASS__ . '::event_details',
|
'event_details' => __CLASS__ . '::event_details',
|
||||||
'event_performance' => __CLASS__ . '::event_performance',
|
'event_performance' => __CLASS__ . '::event_performance',
|
||||||
'countdown' => __CLASS__ . '::countdown',
|
'countdown' => __CLASS__ . '::countdown',
|
||||||
'event_calendar' => __CLASS__ . '::event_calendar',
|
|
||||||
'event_list' => __CLASS__ . '::event_list',
|
|
||||||
'event_blocks' => __CLASS__ . '::event_blocks',
|
|
||||||
'league_table' => __CLASS__ . '::league_table',
|
|
||||||
'player_details' => __CLASS__ . '::player_details',
|
'player_details' => __CLASS__ . '::player_details',
|
||||||
'player_statistics' => __CLASS__ . '::player_statistics',
|
'player_statistics' => __CLASS__ . '::player_statistics',
|
||||||
'player_list' => __CLASS__ . '::player_list',
|
|
||||||
'player_gallery' => __CLASS__ . '::player_gallery',
|
|
||||||
'staff' => __CLASS__ . '::staff',
|
'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',
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
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',
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
foreach ( $shortcodes as $shortcode => $function ) {
|
foreach ( $shortcodes as $shortcode => $function ) {
|
||||||
add_shortcode( $shortcode, $function );
|
add_shortcode( $shortcode, $function );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Core
|
* @category Core
|
||||||
* @package SportsPress/Functions
|
* @package SportsPress/Functions
|
||||||
* @version 1.5
|
* @version 1.6
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -1188,7 +1188,7 @@ function sp_get_text_options() {
|
|||||||
function sp_review_link() {
|
function sp_review_link() {
|
||||||
?>
|
?>
|
||||||
<p>
|
<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' ); ?>
|
<?php _e( 'Love SportsPress? Help spread the word by rating us 5★ on WordPress.org', 'sportspress' ); ?>
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ add_action( 'get_the_generator_xhtml', 'sp_generator_tag', 10, 2 );
|
|||||||
* @see sportspress_output_event_performance()
|
* @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_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_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_details', 30 );
|
||||||
add_action( 'sportspress_single_event_content', 'sportspress_output_event_venue', 40 );
|
add_action( 'sportspress_single_event_content', 'sportspress_output_event_venue', 40 );
|
||||||
add_action( 'sportspress_single_event_content', 'sportspress_output_event_performance', 50 );
|
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_logo', 0 );
|
||||||
add_action( 'sportspress_single_team_content', 'sportspress_output_team_details', 10 );
|
add_action( 'sportspress_single_team_content', 'sportspress_output_team_details', 10 );
|
||||||
add_action( 'sportspress_single_team_content', 'sportspress_output_team_lists', 20 );
|
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
|
||||||
add_action( 'sportspress_single_team_content', 'sportspress_output_team_tables', 30 );
|
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
|
* After Single Team
|
||||||
|
|||||||
@@ -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).
|
* Subscribe to our [YouTube channel](https://www.youtube.com/user/themeboyteam).
|
||||||
* Follow ThemeBoy on [Facebook](https://facebook.com/themeboy) & [Twitter](http://twitter.com/themeboy).
|
* Follow ThemeBoy on [Facebook](https://facebook.com/themeboy) & [Twitter](http://twitter.com/themeboy).
|
||||||
|
|
||||||
|
|
||||||
= Please Rate, Vote, and Enjoy! =
|
= Please Rate, Vote, and Enjoy! =
|
||||||
Your feedback is much appreciated and makes all the difference in improving SportsPress.
|
Your feedback is much appreciated and makes all the difference in improving SportsPress.
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ final class SportsPress {
|
|||||||
*/
|
*/
|
||||||
protected static $_instance = null;
|
protected static $_instance = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var SP_Modules $modules
|
||||||
|
*/
|
||||||
|
public $modules = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var SP_Countries $countries
|
* @var SP_Countries $countries
|
||||||
*/
|
*/
|
||||||
@@ -212,6 +217,7 @@ final class SportsPress {
|
|||||||
include_once( 'includes/abstracts/abstract-sp-custom-post.php' ); // Custom posts
|
include_once( 'includes/abstracts/abstract-sp-custom-post.php' ); // Custom posts
|
||||||
|
|
||||||
// Classes (used on all pages)
|
// 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-countries.php' ); // Defines continents and countries
|
||||||
include_once( 'includes/class-sp-formats.php' ); // Defines custom post type formats
|
include_once( 'includes/class-sp-formats.php' ); // Defines custom post type formats
|
||||||
include_once( 'includes/class-sp-feeds.php' ); // Adds feeds
|
include_once( 'includes/class-sp-feeds.php' ); // Adds feeds
|
||||||
@@ -247,12 +253,18 @@ final class SportsPress {
|
|||||||
*/
|
*/
|
||||||
public function include_widgets() {
|
public function include_widgets() {
|
||||||
include_once( 'includes/widgets/class-sp-widget-countdown.php' );
|
include_once( 'includes/widgets/class-sp-widget-countdown.php' );
|
||||||
include_once( 'includes/widgets/class-sp-widget-event-calendar.php' );
|
if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) {
|
||||||
include_once( 'includes/widgets/class-sp-widget-event-list.php' );
|
include_once( 'includes/widgets/class-sp-widget-event-calendar.php' );
|
||||||
include_once( 'includes/widgets/class-sp-widget-event-blocks.php' );
|
include_once( 'includes/widgets/class-sp-widget-event-list.php' );
|
||||||
include_once( 'includes/widgets/class-sp-widget-league-table.php' );
|
include_once( 'includes/widgets/class-sp-widget-event-blocks.php' );
|
||||||
include_once( 'includes/widgets/class-sp-widget-player-list.php' );
|
}
|
||||||
include_once( 'includes/widgets/class-sp-widget-player-gallery.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' );
|
include_once( 'includes/widgets/class-sp-widget-staff.php' );
|
||||||
|
|
||||||
do_action( 'sportspress_widgets' );
|
do_action( 'sportspress_widgets' );
|
||||||
@@ -269,6 +281,7 @@ final class SportsPress {
|
|||||||
$this->load_plugin_textdomain();
|
$this->load_plugin_textdomain();
|
||||||
|
|
||||||
// Load class instances
|
// Load class instances
|
||||||
|
$this->modules = new SP_Modules(); // Modules class
|
||||||
$this->countries = new SP_Countries(); // Countries class
|
$this->countries = new SP_Countries(); // Countries class
|
||||||
$this->formats = new SP_Formats(); // Formats class
|
$this->formats = new SP_Formats(); // Formats class
|
||||||
$this->feeds = new SP_Feeds(); // Feeds class
|
$this->feeds = new SP_Feeds(); // Feeds class
|
||||||
@@ -351,6 +364,6 @@ function SP() {
|
|||||||
return SportsPress::instance();
|
return SportsPress::instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
SP();
|
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
SP();
|
||||||
|
|||||||
Reference in New Issue
Block a user