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
// Dissable core auto update notices if sucessful. | |
add_filter( 'auto_core_update_send_email', 'capweb_stop_auto_update_emails', 10, 4 ); | |
function capweb_stop_update_emails( $send, $type, $core_update, $result ) { | |
if ( ! empty( $type ) && $type == 'success' ) { | |
return false; | |
} | |
return true; | |
} | |
// Dissable theme and plugin auto update notices. | |
add_filter( 'auto_plugin_update_send_email', '__return_false' ); |
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 | |
/* | |
Plugin Name: Gravity Forms Honeypot Enabler | |
Description: Enables the honeypot setting for all Gravity Forms on your website. | |
Version: 1.0 | |
Author: Your Name | |
*/ | |
// Hook into WordPress initialization | |
add_action('init', 'enable_gravity_forms_honeypot'); |
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
if ( ! function_exists( 'text-domain_remove_title_wptexturize' ) ) { | |
/** | |
* Turn off WP default smart quote conversions in post title. | |
*/ | |
function text-domain_remove_title_wptexturize() { | |
remove_filter( 'the_title', 'wptexturize' ); | |
} |
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
# ----------------------------------------------------------------- | |
# .gitignore | |
# Bare Minimum Git | |
# https://salferrarello.com/starter-gitignore-file/ | |
# ver 20220720 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/salcode/10017553/raw/.gitignore | |
# to download this file | |
# |
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_action('woocommerce_cart_calculate_fees', 'add_custom_discount_2nd_at_50', 10, 1 ); | |
function add_custom_discount_2nd_at_50( $wc_cart ){ | |
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; | |
// Get out of here if we are past the specific date set in the dateDifference function below. | |
if ( 0 > tew_dateDifferenceEOM( '2021-06-30') ) return; | |
$discount = 0; | |
$items_prices = array(); |
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
# cd into the root of your MainWP dashboard site | |
# Note: your wordpress install may be at a different location on your web host | |
# This example is an apache host where I ssh into the root of the server | |
cd ../var/www/html | |
# run wp-cli command to list all your MainWP child sites | |
wp mainwp sites | |
# output looks like this (withou the # symbol - that is a comment indicator) | |
#+----+---------------------------+------------------------+---------+ | |
#| id | name | url | version | | |
#+----+---------------------------+------------------------+---------+ |
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
# bash shell | |
#Log into server via bitvise ssh - good multi-line shell handling | |
cd ../var/www/html | |
# Get listing of all MainWP sites | |
wp --allow-root mainwp sites | |
# Run Sucuri scan on each | |
for i in 1 3 4 5 7 8 11 13 14 16 17 18; do wp --allow-root mainwp-sucuri scan $i; done |
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 phpinfo();?> |
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
// Ref: https://github.com/skyverge/wc-plugins-snippets/blob/master/woocommerce-customer-order-csv-export/add-product-attributes-to-one-row-per-item-order-export.php | |
/** | |
* Adds size attribute to the one row per item order export | |
* CANNOT be used with non-one row per item formats | |
*/ | |
/** | |
* Add a 'size' column to the export file | |
* | |
* @param array $headers | |
* @return array |
NewerOlder