Keep first name - \s(.*)
Keep last name - ^\S*
Remove numbers from end of string \d(.*)
<?php | |
add_action('woocommerce_email_before_order_table', 'custom_order_header', 20, 4); | |
function custom_order_header( $order, $sent_to_admin, $plain_text, $email ) { | |
if ($email->id == 'customer_processing_order') { | |
echo '<p>Once your order is processed...</p>'; | |
} | |
} |
// https://ghostscript.com/doc/current/Ps2pdf.htm | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf |
grep '1/Oct/2018' /var/www/vhosts/system/*/logs/access_log | awk '{print $1,$7}' | sort | uniq -c | sort -nr | head -100 |
version: "3.3" | |
services: | |
my-wpdb: | |
image: mariadb | |
ports: | |
- "8081:3306" | |
environment: | |
MYSQL_DATABASE: wordpress | |
MYSQL_ROOT_PASSWORD: password | |
volumes: |
Keep first name - \s(.*)
Keep last name - ^\S*
Remove numbers from end of string \d(.*)
/* These functions are set to run on init and can be removed after they've run once. There is no need to keep them in the functions file */ | |
/* Credit goes to https://ryanbenhase.com/giving-editors-access-to-gravity-forms/ */ | |
////////////////// | |
// GRANT ACCESS // | |
////////////////// | |
function grant_gforms_editor_access() { | |
$role = get_role( 'editor' ); | |
$role->add_cap( 'gform_full_access' ); | |
} | |
add_action( 'init', 'grant_gforms_editor_access' ); |
<h3>JS</h3> | |
<script> | |
function setCookie(cname, cvalue, exdays) { | |
var d = new Date(); | |
d.setTime(d.getTime()+(exdays*24*60*60*1000)); | |
var expires = "expires="+d.toGMTString(); | |
document.cookie = cname + "=" + cvalue + "; " + expires + '; path=/'; | |
} |
pscp [email protected]:/home/username/file-to-download.zip C:\Users\Username\new-file.zip |
/* find all matches for strings starting with 2070 in the fire_date column of the termmeta table */ | |
SELECT * FROM `as9g6f0_termmeta` WHERE `meta_key` LIKE 'fire_date' AND `meta_value` LIKE '2070%'; | |
/* find all matches for strings starting with 2070 in the fire_date column of the termmeta table and replace them with 1970 */ | |
UPDATE as9g6f0_termmeta | |
SET meta_value = REPLACE(meta_value,'2070','1970') | |
WHERE `meta_key` LIKE 'fire_date' AND `meta_value` LIKE '2070%'; |