This file contains hidden or 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
// ==UserScript== | |
// @name Aliexpress | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://trade.aliexpress.com/orderList.htm* | |
// @grant unsafeWindow | |
// @grant GM_xmlhttpRequest | |
// @grant GM_setClipboard |
This file contains hidden or 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 insert_product ($product_data) | |
{ | |
$post = array( // Set up the basic post data to insert for our product | |
'post_author' => 1, | |
'post_content' => $product_data['description'], | |
'post_status' => 'publish', | |
'post_title' => $product_data['name'], | |
'post_parent' => '', |
This file contains hidden or 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_action( 'wc_gateway_stripe_process_response', 'prefix_wc_gateway_stripe_process_response', 20, 2 ); | |
function prefix_wc_gateway_stripe_process_response( $response, $order ){ | |
if($response->source->type == 'three_d_secure'){ | |
$order->update_status('completed', 'order_note'); #### | |
//WC_Stripe_Logger::log( 'wc_gateway_stripe_process_response three_d_secure response: ' . print_r( $response->source->type, true ) ); | |
}elseif($response->source->type == 'card'){ | |
$order->update_status('failed', 'order_note'); #### | |
//WC_Stripe_Logger::log( 'wc_gateway_stripe_process_response card response: ' . print_r( $response->source->type, true ) ); | |
} | |
} |
This file contains hidden or 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 shortcode to list all clothes which come in blue | |
function statesmen_news_shortcode( $atts ) { | |
$html = ''; | |
// Attributes | |
$atts = shortcode_atts( | |
array( | |
'post_per_page' => '2', | |
'post_type' => 'post', | |
'id' => false | |
), |