Fix bugs, use plural post slugs, move actions and filters into hooks folder
This commit is contained in:
24
admin/hooks/the-content.php
Normal file
24
admin/hooks/the-content.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
function sportspress_the_content( $content ) {
|
||||
if ( is_singular( 'sp_team' ) && in_the_loop() ):
|
||||
|
||||
elseif ( is_singular( 'sp_table' ) && in_the_loop() ):
|
||||
|
||||
global $post;
|
||||
|
||||
// Display league table
|
||||
$content .= sportspress_league_table( $post->ID );
|
||||
|
||||
elseif ( is_singular( 'sp_list' ) && in_the_loop() ):
|
||||
|
||||
global $post;
|
||||
|
||||
// Display player list
|
||||
$content .= sportspress_player_list( $post->ID );
|
||||
|
||||
endif;
|
||||
|
||||
return $content;
|
||||
}
|
||||
add_filter( 'the_content', 'sportspress_the_content' );
|
||||
add_filter( 'get_the_content', 'sportspress_the_content' );
|
||||
Reference in New Issue
Block a user