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 | |
// wpcf7_validate + _textarea* or _text* etc | |
add_filter( 'wpcf7_validate_textarea*', 'textarea_confirmation_validation_filter', 20, 2 ); | |
function textarea_confirmation_validation_filter( $result, $tag ) { | |
// your-message much match what the tag name has been set | |
if ( 'your-message' == $tag->name ) { | |
$your_message = isset( $_POST['your-message'] ) ? trim( $_POST['your-message'] ) : ''; | |
if ( preg_match('/href|google|lottery|seo|http|latex|gloves|youtube|instagram|monetize|invest|\$|\@|www\./i', $your_message ) ){ | |
$result->invalidate( $tag, "Your message contains invalid words that are not allowed, please rephrase. only put your email address in the email section, No website links or any of these words: href, google, seo, http, latex, gloves, youtube, instagram, monetize, invest, $" ); |
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
add_filter( 'wpcf7_validate_text*', 'custom_phone_confirmation_validation_filter', 20, 2 ); | |
function custom_phone_confirmation_validation_filter( $result, $tag ) { | |
if ( 'your-phone' == $tag->name ) { | |
$your_phone = isset( $_POST['your-phone'] ) ? trim( $_POST['your-phone'] ) : ''; | |
if ( !preg_match('/^0/', $your_phone ) ){ | |
$result->invalidate( $tag, "Needs to start with a zero, are you a bot?" ); | |
} | |
} | |
return $result; | |
} |
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
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !/robots.txt$ | |
RewriteCond %{HTTP_USER_AGENT} ^$ [OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*EventMachine.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*NerdyBot.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*Typhoeus.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*archive.org_bot.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*archive.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*adbeat_bot.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*github.*$ [NC,OR] |
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
# | |
# Grabs the product json and merges with the stock scrapey file and then imports using REST | |
import json, sys | |
import keys_file | |
from woocommerce import API | |
wcapi = API( | |
url=url, # Your store URL | |
consumer_key = consumer_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
// Add Variation Settings | |
add_action( 'woocommerce_product_after_variable_attributes', 'variation_settings_fields', 10, 3 ); | |
// Save Variation Settings | |
add_action( 'woocommerce_save_product_variation', 'save_variation_settings_fields', 10, 2 ); | |
/** | |
* Create new fields for variations | |
* | |
*/ |
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
# exiftool file.jpg {views file} | |
# exiftool -Make="Canon" | |
# exiftool -Model="Canon EOS 40D" | |
import random | |
from geopy.geocoders import Nominatim | |
from GPSPhoto import gpsphoto | |
import sys, os | |
geolocator = Nominatim(user_agent="geodata") |
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
#go|dfish is the boss of freenode | |
# merge duplicate records category, resulting in single record for id | |
jq 'group_by(.sku) | map(.[0].cat = ([.[].cat] | join(",")) | .[0])' q-products-new.json > q-merged.json |
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
PPH08CH_par | |
PPH08CH | |
PPH08BN | |
PPH080RB | |
PPH08BR | |
JRG537CH_par | |
JRG537CH | |
JRG537BR | |
JRG537BN | |
GRA390SC_par |
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 | |
$value = get_field( 'extra-docs' ); | |
if ($value) { | |
$exfiles = explode( ',', $value ); | |
//var_dump($exfiles) | |
?> | |
<div class="extra-docs"> | |
<p>Additional documents:</p> | |
<p>To view the cut out template files and technial specifiations view or download the pdf template files that come with this product</p> | |
<?php foreach ( $exfiles as $solofile ){ ?> |
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
/* Alpha blue aka aspire */ | |
#228ace |
NewerOlder