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
<?php | |
// Add this code to your theme or child theme `functions.php` file. | |
/** | |
* Override SportsPress Pro sponsor permalinks with actual sponsors links | |
* | |
* @author Nabil Kadimi - ThemeBoy Support | |
* @link http://tboy.co | |
*/ |
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
<?php | |
/** | |
* Force `HH:MM:SS` format for prformance stats of type `time`. | |
*/ | |
add_filter( 'sportspress_event_performance_players', function( $data ) { | |
foreach ( $data as $i => &$stats ) { | |
foreach ( $stats as $key => &$value ) { | |
$perf = get_posts( array( | |
'name' => $key, |
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
<?php | |
/** | |
* Require first name and last name in WordPay registration. | |
*/ | |
/** | |
* Add '*' after first name and last name labels. | |
*/ | |
add_filter( 'wpay_register_form_label_first_name', function( $value ) { return "$value *"; } ); |
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
<?php | |
/* | |
Plugin Name: BuddyPress Label for SportsPress | |
Plugin URI: https://www.themeboy.com/sportspress-extensions/buddypress/ | |
Description: Plugin allows changing the label of SportPress within BuddyPress pages, go to "SportsPress > Settings > Text" then scroll down to the latest option "SportsPress (BuddyPress)" and fill it with your choice. | |
Author: Nabil Kadimi - Support Engineer at ThemeBoy | |
Version: 1.0.0 | |
License: GNU General Public License v3.0 | |
License URI: http://www.gnu.org/licenses/gpl-3.0.html |
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
<?php | |
/** | |
* Change teams abbreviations into short names. | |
*/ | |
add_action( 'admin_init', function() { | |
/** | |
* Admin(s) only. | |
*/ |
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
<?php | |
/** | |
* The template for displaying archive pages. | |
* | |
* Learn more: http://codex.wordpress.org/Template_Hierarchy | |
* | |
* @package Rookie | |
*/ | |
get_header(); ?> |
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
<?php | |
add_filter( 'sportspress_player_admin_columns', function( $c ) { | |
return array_merge( $c + [ 'date' => 'Birth Date' ] ); | |
} ); |
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
<?php | |
/** | |
* Order SportsPress events by date in ascending order in the dashboard. | |
*/ | |
add_action( 'admin_init', function() { | |
if ( empty( $_GET[ 'post_type' ] || 'sp_event' !== $_GET[ 'post_type' ] ) ) { | |
return; | |
} | |
if ( ! empty( $_GET[ 'orderby' ] ) ) { |
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
<?php | |
/* | |
Plugin Name: BuddyPress Label for SportsPress | |
Plugin URI: https://www.themeboy.com/sportspress-extensions/buddypress/ | |
Description: Plugin allows changing the label of SportPress within BuddyPress pages, go to "SportsPress > Settings > Text" then scroll down to the latest option "SportsPress (BuddyPress)" and fill it with your choice. | |
Author: Nabil Kadimi - Support Engineer at ThemeBoy | |
Version: 1.0.0 | |
License: GNU General Public License v3.0 | |
License URI: http://www.gnu.org/licenses/gpl-3.0.html |
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
<?php | |
add_filter( 'sportspress_player_data_event_args', function( $args ) { | |
foreach ( $args[ 'meta_query' ] as &$m ) { | |
if ( true | |
&& is_array( $m ) | |
&& array_key_exists( 'key', $m ) | |
&& in_array($m[ 'key' ], [ 'sp_offense', 'sp_defense' ] ) | |
) { | |
$m = null; |