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

@@ -1,5 +1,5 @@
<?php
function sp_admin_post_thumbnail_html( $translated_text, $post_id ) {
function sportspress_admin_post_thumbnail_html( $translated_text, $post_id ) {
$texts = array(
'sp_team' => array(
'Set featured image' => 'Select Logo',
@@ -23,4 +23,4 @@ function sp_admin_post_thumbnail_html( $translated_text, $post_id ) {
endif;
return $translated_text;
}
add_filter( 'admin_post_thumbnail_html', 'sp_admin_post_thumbnail_html', 10, 2 );
add_filter( 'admin_post_thumbnail_html', 'sportspress_admin_post_thumbnail_html', 10, 2 );

View File

@@ -1,5 +1,5 @@
<?php
function sp_gettext( $translated_text, $untranslated_text, $domain ) {
function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
global $typenow;
$texts = array(
@@ -40,4 +40,4 @@ function sp_gettext( $translated_text, $untranslated_text, $domain ) {
else
return $translated_text;
}
add_filter( 'gettext', 'sp_gettext', 20, 3 );
add_filter( 'gettext', 'sportspress_gettext', 20, 3 );

View File

@@ -1,5 +1,5 @@
<?php
function sp_pre_get_posts( $wp_query ) {
function sportspress_pre_get_posts( $wp_query ) {
if ( is_admin() ):
$post_type = $wp_query->query['post_type'];
@@ -12,4 +12,4 @@ function sp_pre_get_posts( $wp_query ) {
endif;
endif;
}
add_filter('pre_get_posts', 'sp_pre_get_posts');
add_filter('pre_get_posts', 'sportspress_pre_get_posts');

View File

@@ -1,5 +1,5 @@
<?php
function sp_sanitize_title( $title ) {
function sportspress_sanitize_title( $title ) {
if ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic' ) ) ):
@@ -7,7 +7,7 @@ function sp_sanitize_title( $title ) {
if ( ! $key ) $key = $_POST['post_title'];
$title = sp_get_eos_safe_slug( $key, sp_array_value( $_POST, 'ID', 'var' ) );
$title = sportspress_get_eos_safe_slug( $key, sportspress_array_value( $_POST, 'ID', 'var' ) );
elseif ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && $_POST['post_type'] == 'sp_event' ):
@@ -22,4 +22,4 @@ function sp_sanitize_title( $title ) {
return $title;
}
add_filter( 'sanitize_title', 'sp_sanitize_title' );
add_filter( 'sanitize_title', 'sportspress_sanitize_title' );

View File

@@ -7,14 +7,14 @@ function sportspress_the_content( $content ) {
global $post;
// Display league table
$content .= '<p>' . sp_get_table_html( $post->ID ) . '</p>';
$content .= '<p>' . sportspress_league_table( $post->ID ) . '</p>';
elseif ( is_singular( 'sp_list' ) && in_the_loop() ):
global $post;
// Display player list
$content .= '<p>' . sp_get_list_html( $post->ID ) . '</p>';
$content .= '<p>' . sportspress_player_list( $post->ID ) . '</p>';
endif;

View File

@@ -1,5 +1,5 @@
<?php
function sp_insert_post_data( $data, $postarr ) {
function sportspress_insert_post_data( $data, $postarr ) {
if( $data['post_type'] == 'sp_event' && $data['post_title'] == '' ):
@@ -16,4 +16,4 @@ function sp_insert_post_data( $data, $postarr ) {
return $data;
}
add_filter( 'wp_insert_post_data' , 'sp_insert_post_data' , '99', 2 );
add_filter( 'wp_insert_post_data' , 'sportspress_insert_post_data' , '99', 2 );