Created
February 25, 2020 17:43
-
-
Save kadimi/9f37168f5f4a4fc9ebf5c1a6bbb73586 to your computer and use it in GitHub Desktop.
Do not show user results and user scores forms if the main result is set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/** | |
* Do not show user results and user scores forms if the main result is set. | |
*/ | |
add_filter( 'sportspress_event_templates', function( $templates ) { | |
if ( sp_get_main_results( get_the_ID() ) ) { | |
unset( $templates[ 'user_results' ] ); | |
unset( $templates[ 'user_scores' ] ); | |
} | |
return $templates; | |
}, PHP_INT_MAX ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment