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
// remove plugin update messages | |
remove_action( 'load-update-core.php', 'wp_update_plugins' ); | |
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) ); |
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
INSERT IGNORE INTO _customers (`User ID`, Username) | |
SELECT `User ID`, Username | |
FROM _customers_import |
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
INSERT INTO _customers (`User ID`, Username, `Billing: Full Name` ) | |
SELECT `User ID`, Username, `Billing: Full Name` | |
FROM _customers_import | |
ON DUPLICATE KEY UPDATE Username=values(Username), `Billing: Full Name`=values(`Billing: Full Name`) |
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
//make billing fields not required in checkout | |
add_filter( 'woocommerce_billing_fields', 'wc_npr_filter_phone', 10, 1 ); | |
function wc_npr_filter_phone( $address_fields ) { | |
$address_fields['billing_phone']['required'] = false; | |
return $address_fields; | |
} | |
//make shipping fields not required in checkout | |
add_filter( 'woocommerce_shipping_fields', 'wc_npr_filter_shipping_fields', 10, 1 ); | |
function wc_npr_filter_shipping_fields( $address_fields ) { |
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
global $user_ID; | |
if($user_ID) { | |
if(!current_user_can('administrator')) { | |
if (strlen($_SERVER['REQUEST_URI']) > 255 || | |
stripos($_SERVER['REQUEST_URI'], "eval(") || | |
stripos($_SERVER['REQUEST_URI'], "CONCAT") || | |
stripos($_SERVER['REQUEST_URI'], "UNION+SELECT") || | |
stripos($_SERVER['REQUEST_URI'], "base64")) { | |
@header("HTTP/1.1 414 Request-URI Too Long"); | |
@header("Status: 414 Request-URI Too Long"); |
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('login_errors',create_function('$a', "return null;")); |
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
define('FORCE_SSL_ADMIN', true); |
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 | |
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
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 | |
// Copies woocommerce orders and users over from source to target. | |
// I use this on my local machine - loading both db's up there side by side | |
// could easily adjust the connect strings to connect elsewhere if needed. | |
// will change order ids | |
// My use case for this is when I've got a staging/test version of a site with new posts/products/pages etc, that needs | |
// to go live without the loss of any orders placed on the site site since we copied it to the staging site. |
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 | |
/* | |
Template Name: Print Processing Orders :) | |
*/ | |
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.'); | |
?> | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
OlderNewer