Clean up config settings page tables
This commit is contained in:
@@ -25,7 +25,6 @@ function sp_column_edit_columns() {
|
||||
'title' => __( 'Label', 'sportspress' ),
|
||||
'sp_equation' => __( 'Equation', 'sportspress' ),
|
||||
'sp_order' => __( 'Sort Order', 'sportspress' ),
|
||||
'sp_key' => __( 'Key', 'sportspress' ),
|
||||
'sp_abbreviation' => __( 'Abbreviation', 'sportspress' )
|
||||
);
|
||||
return $columns;
|
||||
|
||||
@@ -24,7 +24,7 @@ function sp_statistic_edit_columns() {
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'title' => __( 'Label', 'sportspress' ),
|
||||
'sp_equation' => __( 'Equation', 'sportspress' ),
|
||||
'sp_key' => __( 'Key', 'sportspress' ),
|
||||
'sp_order' => __( 'Sort Order', 'sportspress' ),
|
||||
'sp_abbreviation' => __( 'Abbreviation', 'sportspress' )
|
||||
);
|
||||
return $columns;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<th><?php _e( 'Label', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'Equation', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'Sort Order', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'Abbreviation', 'sportspress' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php $i = 0; foreach ( $data as $row ): ?>
|
||||
@@ -48,11 +49,21 @@
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$abbreviation = get_post_meta ( $row->ID, 'sp_abbreviation', true );
|
||||
if ( $abbreviation ):
|
||||
echo $abbreviation;
|
||||
else:
|
||||
echo $row->post_title;
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i++; endforeach; ?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="3"><a href="<?php echo admin_url( 'edit.php?post_type=sp_column' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Table Columns', 'sportspress' ) ); ?></a></th>
|
||||
<th colspan="4"><a href="<?php echo admin_url( 'edit.php?post_type=sp_column' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Table Columns', 'sportspress' ) ); ?></a></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -74,6 +85,7 @@
|
||||
<th><?php _e( 'Label', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'Equation', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'Sort Order', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'Abbreviation', 'sportspress' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php $i = 0; foreach ( $data as $row ): ?>
|
||||
@@ -107,11 +119,21 @@
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$abbreviation = get_post_meta ( $row->ID, 'sp_abbreviation', true );
|
||||
if ( $abbreviation ):
|
||||
echo $abbreviation;
|
||||
else:
|
||||
echo $row->post_title;
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i++; endforeach; ?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="3"><a href="<?php echo admin_url( 'edit.php?post_type=sp_column' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Statistics', 'sportspress' ) ); ?></a></th>
|
||||
<th colspan="4"><a href="<?php echo admin_url( 'edit.php?post_type=sp_statistic' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Statistics', 'sportspress' ) ); ?></a></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
21
presets/presets.php
Normal file
21
presets/presets.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
$sportspress_sports = array();
|
||||
|
||||
include_once dirname( __FILE__ ) . '/soccer.php';
|
||||
include_once dirname( __FILE__ ) . '/football.php';
|
||||
include_once dirname( __FILE__ ) . '/footy.php';
|
||||
include_once dirname( __FILE__ ) . '/baseball.php';
|
||||
include_once dirname( __FILE__ ) . '/basketball.php';
|
||||
include_once dirname( __FILE__ ) . '/gaming.php';
|
||||
include_once dirname( __FILE__ ) . '/cricket.php';
|
||||
include_once dirname( __FILE__ ) . '/golf.php';
|
||||
include_once dirname( __FILE__ ) . '/handball.php';
|
||||
include_once dirname( __FILE__ ) . '/hockey.php';
|
||||
include_once dirname( __FILE__ ) . '/racing.php';
|
||||
include_once dirname( __FILE__ ) . '/rugby.php';
|
||||
include_once dirname( __FILE__ ) . '/swimming.php';
|
||||
include_once dirname( __FILE__ ) . '/tennis.php';
|
||||
include_once dirname( __FILE__ ) . '/volleyball.php';
|
||||
|
||||
$sportspress_sports[] = array( 'name' => __( 'Custom', 'sportspress' ), 'posts' => array() );
|
||||
?>
|
||||
@@ -133,7 +133,7 @@ add_action( 'manage_posts_columns', 'sp_manage_posts_columns' );
|
||||
function sp_restrict_manage_posts() {
|
||||
sp_highlight_admin_menu();
|
||||
global $typenow, $wp_query;
|
||||
if ( in_array( $typenow, array( 'sp_event', 'sp_player', 'sp_staff', 'sp_table', 'sp_list', 'sp_tournament' ) ) ):
|
||||
if ( in_array( $typenow, array( 'sp_event', 'sp_player', 'sp_staff', 'sp_table', 'sp_list' ) ) ):
|
||||
$selected = isset( $_REQUEST['sp_team'] ) ? $_REQUEST['sp_team'] : null;
|
||||
$args = array(
|
||||
'show_option_none' => sprintf( __( 'All %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
|
||||
@@ -143,7 +143,7 @@ function sp_restrict_manage_posts() {
|
||||
);
|
||||
// wp_dropdown_pages( $args );
|
||||
endif;
|
||||
if ( in_array( $typenow, array( 'sp_player', 'sp_staff' ) ) ):
|
||||
if ( in_array( $typenow, array( 'sp_player' ) ) ):
|
||||
$selected = isset( $_REQUEST['sp_position'] ) ? $_REQUEST['sp_position'] : null;
|
||||
$args = array(
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Positions', 'sportspress' ) ),
|
||||
|
||||
@@ -121,6 +121,9 @@ function sp_pre_get_posts( $wp_query ) {
|
||||
if ( in_array( $post_type, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic' ) ) ):
|
||||
$wp_query->set( 'orderby', 'menu_order' );
|
||||
$wp_query->set( 'order', 'ASC' );
|
||||
elseif ( $post_type == 'sp_event' ):
|
||||
$wp_query->set( 'orderby', 'post_date' );
|
||||
$wp_query->set( 'order', 'ASC' );
|
||||
endif;
|
||||
endif;
|
||||
}
|
||||
|
||||
@@ -1348,7 +1348,6 @@ if ( !function_exists( 'sp_get_list_html' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( !function_exists( 'sp_highlight_admin_menu' ) ) {
|
||||
function sp_highlight_admin_menu() {
|
||||
global $parent_file, $submenu_file;
|
||||
|
||||
@@ -1,21 +1,4 @@
|
||||
<?php
|
||||
$sportspress_sports = array();
|
||||
include_once dirname( __FILE__ ) . '/presets/soccer.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/football.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/footy.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/baseball.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/basketball.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/gaming.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/cricket.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/golf.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/handball.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/hockey.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/racing.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/rugby.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/swimming.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/tennis.php';
|
||||
include_once dirname( __FILE__ ) . '/presets/volleyball.php';
|
||||
|
||||
$sportspress_texts = array(
|
||||
'sp_team' => array(
|
||||
'Enter title here' => __( 'Team', 'sportspress' ),
|
||||
|
||||
@@ -31,7 +31,7 @@ include dirname( __FILE__ ) . '/sportspress-globals.php' ;
|
||||
require_once dirname( __FILE__ ) . '/sportspress-functions.php';
|
||||
|
||||
// Settings
|
||||
include dirname( __FILE__ ) . '/admin/options/options.php' ;
|
||||
include dirname( __FILE__ ) . '/admin/settings/settings.php' ;
|
||||
|
||||
// Custom Post Types
|
||||
require_once dirname( __FILE__ ) . '/admin/post-types/separator.php';
|
||||
@@ -50,6 +50,9 @@ require_once dirname( __FILE__ ) . '/admin/post-types/staff.php';
|
||||
require_once dirname( __FILE__ ) . '/admin/terms/league.php';
|
||||
require_once dirname( __FILE__ ) . '/admin/terms/position.php';
|
||||
|
||||
// Presets
|
||||
include dirname( __FILE__ ) . '/presets/presets.php' ;
|
||||
|
||||
// Install
|
||||
include dirname( __FILE__ ) . '/install.php';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user