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
/* | |
* Please note the wp_ prefix and change accordingly if needed! | |
* Also check the table names so you don't drop data of tables already there! | |
*/ | |
SET NAMES utf8mb4; | |
SET FOREIGN_KEY_CHECKS = 0; | |
-- ---------------------------- | |
-- Table structure for wp_wc_customer_lookup |
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( 'woocommerce_admin_disabled', '__return_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
SET NAMES utf8mb4; | |
SET FOREIGN_KEY_CHECKS = 0; | |
-- ---------------------------- | |
-- Table structure for wp_wc_admin_note_actions | |
-- INFO: This uses the prefix wp_ - change accordingly. | |
-- ---------------------------- | |
DROP TABLE IF EXISTS `wp_wc_admin_note_actions`; | |
CREATE TABLE `wp_wc_admin_note_actions` ( | |
`action_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
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
SET NAMES utf8mb4; | |
SET FOREIGN_KEY_CHECKS = 0; | |
-- ---------------------------- | |
-- Table structure for wp_actionscheduler_actions | |
-- INFO: This uses the prefix wp_ - change accordingly. | |
-- ---------------------------- | |
DROP TABLE IF EXISTS `wp_actionscheduler_actions`; | |
CREATE TABLE `wp_actionscheduler_actions` ( | |
`action_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
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
location /sendy { | |
access_log off; | |
error_log off; | |
rewrite ^/sendy/(l|t|w)/([a-zA-Z0-9\/]+)$ /sendy/$1.php?i=$2&$args; | |
rewrite ^/sendy/(u?n?subscribe)/(.*)$ /sendy/$1.php?i=$2&$args; | |
try_files $uri $uri/ $uri.php?$args; | |
} |
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 | |
$array = [ | |
(object)['ID' => 420, 'name' => "Mary"], | |
(object)['ID' => 10957, 'name' => "Blah"], | |
]; | |
$v=10957; | |
$entry = current(array_filter($array, function($e) use($v) { return $e->ID==$v; })); |
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: WooCommerce Email Customer Address | |
* Plugin URI: https://gist.github.com/BFTrick/7891074 | |
* Description: Email the site admin when a customer changes their address | |
* Author: Patrick Rauland | |
* Author URI: http://patrickrauland.com/ | |
* Version: 1.0.1 | |
* | |
* This program is free software: you can redistribute it and/or modify |
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: Testing Code | |
Description: This is just a test plugin for some actions and filters. | |
Version: 0.1 | |
Author: Con | |
*/ | |
/** | |
* Security measure to prevent direct access. |
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
/** | |
* Gets Variation ID if available otherwise it will get the Product ID | |
* @param $product Product | |
* @param bool $check_variations Whether or not to check for variation IDs | |
* @return mixed | |
*/ | |
function get_id_from_product( $product, $check_variations = false ) { | |
if( $check_variations ) { | |
return ( isset( $product['variation_id'] ) | |
&& ! empty( $product['variation_id']) |