Expand theme prefix and clean up file structure

This commit is contained in:
Brian Miyaji
2014-01-07 17:44:33 +11:00
parent 66c1639e7e
commit 0dd53482b6
40 changed files with 1838 additions and 1851 deletions

View File

@@ -23,9 +23,9 @@
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo $row->post_title; ?></td>
<td><?php echo $row->post_name; ?></td>
<td><?php echo sp_get_post_format( $row->ID ); ?></td>
<td><?php echo sp_get_post_equation( $row->ID ); ?></td>
<td><?php echo sp_get_post_order( $row->ID ); ?></td>
<td><?php echo sportspress_get_post_format( $row->ID ); ?></td>
<td><?php echo sportspress_get_post_equation( $row->ID ); ?></td>
<td><?php echo sportspress_get_post_order( $row->ID ); ?></td>
</tr>
<?php $i++; endforeach; ?>
<tfoot>
@@ -60,9 +60,9 @@
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo $row->post_title; ?></td>
<td><?php echo $row->post_name; ?></td>
<td><?php echo sp_get_post_format( $row->ID ); ?></td>
<td><?php echo sp_get_post_equation( $row->ID ); ?></td>
<td><?php echo sp_get_post_order( $row->ID ); ?></td>
<td><?php echo sportspress_get_post_format( $row->ID ); ?></td>
<td><?php echo sportspress_get_post_equation( $row->ID ); ?></td>
<td><?php echo sportspress_get_post_order( $row->ID ); ?></td>
</tr>
<?php $i++; endforeach; ?>
<tfoot>
@@ -97,7 +97,7 @@
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo $row->post_title; ?></td>
<td><?php echo $row->post_name; ?></td>
<td><?php echo sp_get_post_format( $row->ID ); ?></td>
<td><?php echo sportspress_get_post_format( $row->ID ); ?></td>
<td>—</td>
<td>—</td>
</tr>

View File

@@ -1,17 +1,4 @@
<?php
function sportspress_admin_menu() {
add_options_page(
__( 'SportsPress', 'sportspress' ),
__( 'SportsPress', 'sportspress' ),
'manage_options',
'sportspress',
'sportspress_settings'
);
}
add_action( 'admin_menu', 'sportspress_admin_menu' );
function sportspress_settings() {
$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general';
@@ -45,7 +32,7 @@ function sportspress_validate( $input ) {
$options = get_option( 'sportspress' );
// Do nothing if sport is the same as currently selected
if ( sp_array_value( $options, 'sport', null ) == sp_array_value( $input, 'sport', null ) )
if ( sportspress_array_value( $options, 'sport', null ) == sportspress_array_value( $input, 'sport', null ) )
return $input;
@@ -53,7 +40,7 @@ function sportspress_validate( $input ) {
global $sportspress_sports;
// Get array of post types to insert
$post_groups = sp_array_value( sp_array_value( $sportspress_sports, sp_array_value( $input, 'sport', null ), array() ), 'posts', array() );
$post_groups = sportspress_array_value( sportspress_array_value( $sportspress_sports, sportspress_array_value( $input, 'sport', null ), array() ), 'posts', array() );
// Loop through each post type
foreach( $post_groups as $post_type => $posts ):
@@ -117,32 +104,6 @@ function sportspress_validate( $input ) {
return $input;
}
function sportspress_register_settings() {
register_setting(
'sportspress_general',
'sportspress',
'sportspress_validate'
);
add_settings_section(
'general',
'',
'',
'sportspress_general'
);
add_settings_field(
'sport',
__( 'Sport', 'sportspress' ),
'sportspress_sport_callback',
'sportspress_general',
'general'
);
}
add_action( 'admin_init', 'sportspress_register_settings' );
function sportspress_sport_callback() {
global $sportspress_sports;
$options = get_option( 'sportspress' );