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
/** | |
* `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( '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
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( '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
# /bin/sh | |
# Disable comments on all attachment posts using WP-CLI - #wordpress #spam | |
wp post update --comment_status=closed $(wp post list --post_type=attachment --format=ids) | |
# | |
# Sample Output | |
# ============= | |
# Success: Updated post 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 | |
/** | |
* Set the carousel autoplay speed to 7 seconds. | |
*/ | |
add_action( 'wp_footer', function () { | |
?><script> | |
jQuery( function ( $ ) { | |
$('.rei-land-carousel').slick( 'slickSetOption', 'autoplaySpeed', 7 * 1000 ); | |
} ); | |
</script><?php |
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 | |
/** | |
* Allow text between brackets in Ninja Forms notifications. | |
* | |
* - How to Use: wrap the text you want to put inside curly brackets in double square brackets, e.g. `[[tag]]`. | |
* - Setup: Add this code to your website (I recommend using the plugin Code Snippets). | |
* | |
* @author Nabil @ REI Conversion | |
*/ | |
add_filter( 'ninja_forms_action_email_message', function($message) { |
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 this line. | |
*/ | |
define( 'Custom_BP_SprotsPress_Tab_Slug', 'change-this' ); | |
/** | |
* Do not change below this line. |