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
/** | |
* Provides specific formatting for Australian phone landlines and mobile numbers | |
* | |
* AU Mobile Format: XXXX XXX XXX | |
* Landline Mobile Format: XX XXXX XXXX | |
* | |
* @param $phone_formats | |
* @return mixed | |
*/ | |
function zpd_gf_phone_formats_au( $phone_formats ){ |
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
function wb_login_head(){ | |
?> | |
<style> | |
#login{ | |
width:50%; | |
float:left; | |
} | |
#wbd-login-left{ | |
width:50%; | |
float: right; |
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
/** | |
* Send shipping or billing details to Stripe (required by some 3DSecure transactions/currencies) | |
* | |
* @param $post_data | |
* @param $order | |
* | |
* @return mixed | |
*/ | |
function zpd_add_shipping_to_stripe( $post_data, $order ) { |
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
function gf_alexa_notification( $entry, $form ){ | |
$notifyme_api_url = 'https://api.notifymyecho.com/v1/NotifyMe'; | |
$notifyme_api_secret = '1234567890'; | |
if( $form->ID === 12 ){ | |
// Only for form ID=12 | |
$firstname = rgar( $entry, '1.3' ); | |
$lastname = rgar( $entry, '1.3' ); | |
$phone = rgar( $entry, '2' ); | |
$notification = $firstname . ' ' . $lastname . ' requested a callback on "' . $phone .'"'; |
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
function zpd_wc_order_to_alexa( $payload, $resource, $resource_id, $id){ | |
if( $id == 1) { // webhook ID is 1 | |
// Get an instance of the WC_Order object (same as before) | |
$order = wc_get_order( $resource_id ); | |
$payload[ 'accessCode' ] = ZPD_NOTIFYME_SECRET_API_KEY; | |
$payload[ 'notification'] = 'There is a new ' . $order->get_status() . ' order'; | |
$payload[ 'notification'] .= ' on the ' . get_bloginfo( 'name' ) . ' website'; | |
$payload[ 'notification'] .= ' from ' . $order->get_billing_first_name() . ' ' . $order->get_billing_last_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
<?php | |
/** | |
* See https://woocommerce.github.io/code-reference/classes/WC-Order.html#property_data for all data items in the WC_Order | |
*/ | |
/** | |
* This line is not needed within the filter as $order is passed as a parameter | |
*/ | |
$order_data = $order->get_data(); |
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 Stripe metadata along with WooCommerce purchase | |
* | |
* @param $metadata | |
* @param $order | |
* @param $source | |
* @return mixed | |
*/ | |
function wbdc_filter_wc_stripe_payment_metadata( $metadata, $order, $source ) { |
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
/* Redirect user after check out */ | |
function zpd_wc_global_redirect_after_payment() { | |
global $wp; | |
$redirect_url = 'https://yourdomain.com/this-page/'; | |
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { | |
wp_redirect( $redirect_url ); | |
exit; | |
} |
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
SELECT 'autoloaded data in KiB' as name, ROUND(SUM(LENGTH(option_value))/ 1024) as value FROM wp_options WHERE autoload='yes' | |
UNION | |
SELECT 'autoloaded data count', count(*) FROM wp_options WHERE autoload='yes' | |
UNION | |
(SELECT option_name, length(option_value) FROM wp_options WHERE autoload='yes' ORDER BY length(option_value) DESC LIMIT 10); |
NewerOlder