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 ALL ITEMS IN POST TYPE | |
wp post list --path='./wp' --field=ID --post_type=product --posts_per_page=2000 | xargs wp post delete --force | |
# REMOVE ALL ATTRIBUTES | |
wp wc product_attribute list --context='edit' --path='./wp' --field=id --user=dekode | xargs -n1 -I % sh -c 'echo "Removing attribute %"; wp wc product_attribute delete % --user=dekode' |
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 | |
/** | |
* Custom Translated text for overwriting woocommerce | |
* | |
* @param string $translated_text Custom translated text. | |
* @param string $text Text. | |
* @param string $domain Translation domain. | |
* | |
* @return string|void | |
*/ |
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 | |
/** | |
* Test recurring payments in staging mode. | |
* [USAGE] WooCommerce subscriptin is handling subscriptions as manual subscriptions if the 'stage' mode is on. | |
* Luckly we can hook and filter by signup email. We don't want this to be working with all existing subscriptions so | |
* we are filtering by email. | |
* | |
* [INSTALLATION] This can be packed as mu-plugin. | |
* | |
* [DISCLAMER] This is critical developer only information and it can trigger real payments in your stage environment. |
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 | |
/** | |
* Autocomplete orders in subscription. | |
* | |
* @package CustomWoo | |
*/ | |
declare( strict_types=1 ); | |
namespace Custom\Woo\Extras; |
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 | |
if ( ! function_exists( __NAMESPACE__ . '\\disable_email_styling' ) ) { | |
function disable_email_styling() { | |
add_filter( 'woocommerce_email_styles', '__return_null', 20 ); | |
} | |
add_action( 'init', __NAMESPACE__ . '\\disable_email_styling' ); | |
} |
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
create table wp_custom_payments | |
select | |
p.ID as order_id, | |
p.post_date, | |
p.post_status, | |
max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email, | |
max( CASE WHEN pm.meta_key = '_billing_first_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_first_name, | |
max( CASE WHEN pm.meta_key = '_billing_last_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_last_name, | |
max( CASE WHEN pm.meta_key = '_order_total' and p.ID = pm.post_id THEN pm.meta_value END ) as order_total, | |
max( CASE WHEN pm.meta_key = '_customer_ip_address' and p.ID = pm.post_id THEN pm.meta_value END ) as order_ip, |
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
# Creates empty repo in current folder | |
git init | |
# Links to remote | |
git remote add origin PATH/TO/REPO | |
# Gets remote repo | |
git fetch | |
# Resets to master branch from remote |
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 | |
p.ID as order_id, | |
p.post_date, | |
max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email, | |
max( CASE WHEN pm.meta_key = '_billing_first_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_first_name, | |
max( CASE WHEN pm.meta_key = '_billing_last_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_last_name, | |
max( CASE WHEN pm.meta_key = '_order_total' and p.ID = pm.post_id THEN pm.meta_value END ) as order_total, | |
max( CASE WHEN pm.meta_key = '_payment_method' and p.ID = pm.post_id THEN pm.meta_value END ) as payment_method, | |
max( CASE WHEN pm.meta_key = '_order_tax' and p.ID = pm.post_id THEN pm.meta_value END ) as order_tax, | |
max( CASE WHEN pm.meta_key = '_paid_date' and p.ID = pm.post_id THEN pm.meta_value END ) as paid_date, |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
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
/*! | |
* Color Thief v2.0 | |
* by Lokesh Dhakar - http://www.lokeshdhakar.com | |
* | |
* Thanks | |
* ------ | |
* Nick Rabinowitz - For creating quantize.js. | |
* John Schulz - For clean up and optimization. @JFSIII | |
* Nathan Spady - For adding drag and drop support to the demo page. | |
* |
NewerOlder