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( 'sp_team_events_list_args', function( $args ) { | |
$args[ 'order' ] = 'ASC'; | |
return $args; | |
} ); |
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
youtube-dl -o '%(uploader)s - %(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' |
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_details', function( $data ) { | |
$labels_from_to = [ | |
'موضع' => 'المركز', | |
'الفريق الحالي' => 'النادي', | |
'المواسم' => 'الموسم الرياضي', | |
]; |
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
/** | |
* `removeEndingSubString` removes a substring from the end of a string. | |
* | |
* It will only remove the exact substring. So if the string doesn't end | |
* with the substring, nothing happens and the original string is returned | |
* as is. | |
* | |
* @link https://kadimi.com/ | https://gist.github.com/kadimi/32bb8f4cc56224343992806fd0898322 | |
* @author Nabil Kadimi | |
* |
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( 'gettext', function( $translated_text, $text, $domain ) { | |
if ( 'mega-slider' === $domain ) { | |
if ( 'Read more...' === $text ) { | |
return 'YOUR TEXT HERE'; | |
} | |
} | |
return $translated_text; | |
}, 10, 3 ); |
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 | |
/** | |
* Customize past events list columns. | |
*/ | |
add_action( 'init', function() { | |
/** | |
* Desired columns. | |
* |
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 a player list on the fly to the current team. | |
*/ | |
add_action( | |
'init', | |
function () { | |
/** |
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 | |
function sp_get_players_by_team($team, $current_or_past_or_all = 'all') | |
{ | |
switch ($current_or_past_or_all) { | |
case 'current': | |
$team_key = 'sp_current_team'; | |
break; | |
case 'past': | |
$team_key = 'sp_past_team'; |
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 | |
function sp_get_event_tournaments($event_id) | |
{ | |
return get_posts([ | |
'post_type' => 'sp_tournament', | |
'posts_per_page' => -1, | |
'meta_query' => [ | |
[ | |
'key' => 'sp_event', |