Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kadimi
Created February 25, 2020 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kadimi/9f37168f5f4a4fc9ebf5c1a6bbb73586 to your computer and use it in GitHub Desktop.
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
<?
/**
* 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