Use team website links and output template

This commit is contained in:
Brian Miyaji
2014-06-14 18:10:09 +10:00
parent 208089d4db
commit 6262bda6e8
5 changed files with 59 additions and 3 deletions

View File

@@ -49,7 +49,8 @@ add_action( 'sportspress_single_calendar_content', 'sportspress_output_calendar'
*
* @see sportspress_output_team_columns()
*/
add_action( 'sportspress_single_team_content', 'sportspress_output_team_columns', 10 );
add_action( 'sportspress_single_team_content', 'sportspress_output_team_link', 10 );
add_action( 'sportspress_single_team_content', 'sportspress_output_team_columns', 20 );
/**
* Single Table Content
@@ -207,6 +208,19 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
}
add_filter( 'gettext', 'sportspress_gettext', 20, 3 );
function sportspress_team_permalink( $permalink, $post ) {
if ( ! is_admin() && 'sp_team' == get_post_type( $post ) ):
if ( empty( $post->post_content ) ):
$url = get_post_meta( $post->ID, 'sp_url', true );
if ( ! empty( $url ) ):
return $url;
endif;
endif;
endif;
return $permalink;
}
add_filter( 'post_type_link', 'sportspress_team_permalink', 10, 2 );
function sportspress_pre_get_posts( $query ) {
if ( is_admin() ):