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 | |
/** Hide Yoast SEO alert from everywhere **/ | |
if (is_plugin_active('wordpress-seo/wp-seo.php')) { | |
/* Remove HTML Comments */ | |
add_action('get_header',function() { ob_start(function ($o) { | |
return preg_replace('/\n?<.*?Yoast SEO plugin.*?>/mi','',$o); }); }); | |
add_action('wp_head',function() { ob_end_flush(); }, 999); | |
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 | |
// Should match /category/s/ | |
// Should match /category/tag/s/ | |
// Should match /category/tag/tag/s/ | |
// Etcetera | |
// https://regex101.com/r/sNfHex/1 | |
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_action('enqueue_block_assets', 'maybe_enqueue_scripts_and_styles' ); | |
function maybe_enqueue_scripts_and_styles() { | |
// Map blockname with CSS filename | |
$styles = array( | |
"basic" => "basic" | |
); |
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
RewriteCond %{HTTP_USER_AGENT} \ | |
12soso|\ | |
192\.comagent|\ | |
1noonbot|\ | |
1on1searchbot|\ | |
3de\_search2|\ | |
3d\_search|\ | |
3g\ bot|\ | |
3gse|\ | |
50\.nu|\ |
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/bash | |
# This script uses dig to retrieve the A record for domains | |
# Add your domains in a file called domains.txt, seperated by newlines | |
# Add your expected IP in a parameter -e=123.123.123.123 | |
# Output is ok.txt with domains matching the IP, not-ok.txt with domains failing | |
# Parse parameters | |
for i in "$@" | |
do | |
case $i in |
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 | |
// define the raw_woocommerce_price callback | |
function modify_price_for_currency ( $price, $product ) { | |
global $post, $woocommerce; | |
if( !$product ) return $price; | |
$new_price = $price*0.89; |
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 | |
// Validate dutch mobile phone numbers (international notation) | |
if(!preg_match('/^\+[0-9]{1,2}[ ]\([0-9]{1}\)[ ]([0-9]{9})$/', $telephone)) { | |
$error = 'Use international notation: +31 (0) 612341234'; | |
} |
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 to your functions.php | |
add_action('admin_init', 'theme_disable_yoast_notifications'); | |
function theme_disable_yoast_notifications() { | |
if ( is_plugin_active( 'wordpress-seo/wp-seo.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 | |
class Fulfillment { | |
/** | |
* Constructs and initialize | |
*/ | |
public function __construct() { | |
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('tribe_events_tickets_attendees_csv_items', 'filter_eea_csv_items', 10, 1); | |
function filter_eea_csv_items( $items ) { | |
$first = true; | |
foreach( $items AS $item_row => $item ) { | |
NewerOlder