Skip to content

Instantly share code, notes, and snippets.

@santiazpi
santiazpi / kinsta-staging-update-routine.php
Last active October 12, 2019 02:10 — forked from devinsays/staging-update-routine.php
staging-update-routine.php
<?php
/**
* Update site to use test mode in local and staging environments
*/
function prefix_env_settings() {
// If settings have already been updated, return early
if ( 1 == get_transient( 'staging-settings-updated' ) ) {
return;
}
@santiazpi
santiazpi / staging-update-routine.php
Created October 4, 2019 20:57 — forked from devinsays/staging-update-routine.php
staging-update-routine.php
<?php
/**
* Update site to use test mode in local and staging environments
*/
function prefix_env_settings() {
// If settings have already been updated, return early
if ( 1 == get_transient( 'staging-settings-updated' ) ) {
return;
}
@santiazpi
santiazpi / woo-email.php
Created April 20, 2019 23:45 — forked from goranefbl/woo-email.php
Use woocommerce email template header/footer with your plugin
public function gens_send_email($user_id,$coupon_code) {
if ( !$user_id || !$coupon_code) {
return false;
}
global $woocommerce;
$mailer = $woocommerce->mailer();
$user_info = get_userdata($user_id);
@santiazpi
santiazpi / filter-wc-orders-by-gateway.php
Created March 6, 2018 00:21 — forked from bekarice/filter-wc-orders-by-gateway.php
Filters WooCommerce Orders by Payment Gateway Used
<?php
/**
* Plugin Name: Filter WooCommerce Orders by Payment Method
* Plugin URI: http://skyverge.com/
* Description: Filters WooCommerce orders by the payment method used :)
* Author: SkyVerge
* Author URI: http://www.skyverge.com/
* Version: 1.0.0
* Text Domain: wc-filter-orders-by-payment
*
@santiazpi
santiazpi / pleskCommands.sh
Created January 9, 2018 03:58 — forked from AlexPashley/pleskCommands.sh
PLESK: Useful PLESK common commands
# USEFUL PLESK COMMANDS
# restart plesk
/etc/init.d/psa restart
# reload plesk configs (useful for vhost.conf)
/usr/local/psa/admin/sbin/websrvmng -a -v
# restart qmail
service qmail restart
@santiazpi
santiazpi / .htaccess
Last active December 16, 2016 16:38 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/