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
posts.forEach(function(post) { | |
console.log(post['title']); | |
}); |
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 | |
function email_past_due() { | |
global $wpdb; | |
$mailer = WC_Emails::instance(); | |
$date = date( "Y-m-d H:i:s", current_time( 'timestamp' ) + 86400 * 7 ); | |
$due_orders = $wpdb->get_col( $wpdb->prepare( " | |
SELECT posts.ID | |
FROM {$wpdb->posts} AS posts |
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
<AbsoluteLayout row="3" id="main-layout" width="100%" | |
backgroundImage="~/images/face.jpg"> | |
<Image id="s1" visibility="{{ c1 ? 'visible' : 'collapsed' }}" width="{{ parentWidth }}" | |
left="0" top="0" class="face-sector" src="~/images/face-sectors/top-right.png"> | |
</Image> | |
<Image id="s2" visibility="{{ c2 ? 'visible' : 'collapsed' }}" width="{{ parentWidth }}" | |
left="0" top="0" class="face-sector" src="~/images/face-sectors/top-left.png"> | |
</Image> | |
<Image id="s3" visibility="{{ c3 ? 'visible' : 'collapsed' }}" width="{{ parentWidth }}" | |
left="0" top="0" class="face-sector" src="~/images/face-sectors/bottom-right.png"> |
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
var viewModule = require("ui/core/view"); | |
var gestures = require("ui/gestures"); | |
var observable = require("data/observable"); | |
var pageData = new observable.Observable(); | |
var page; | |
var quad; | |
exports.loaded = function(args) { | |
page = args.object; |
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 | |
add_filter('woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text'); | |
function woo_custom_cart_button_text() { | |
foreach( WC()->cart->get_cart() as $cart_item_key => $values ) { | |
$_product = $values['data']; | |
if( $_product instanceof WC_Product_Subscription && wc_get_product( get_the_ID() ) instanceof WC_Product_Subscription ) { | |
return __('Add to cart', 'woocommerce'); | |
} |
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 | |
/** | |
* Only allow one payment plan purchase (Subscription) at a time | |
*/ | |
add_filter( 'woocommerce_add_to_cart_validation', 'woo_block_sub', 10, 2 ); | |
function woo_block_sub( $valid, $product_id ) { | |
// Get the current product | |
$current_product = wc_get_product( $product_id ); |
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 | |
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); | |
function my_theme_enqueue_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
} | |
/** ========= ALL WOOCOMMERCE FUNCTIONALITY BELOW ========= */ | |
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 | |
/** | |
* In the future this will be the one true location for managing Google analytics | |
*/ | |
/** | |
* Register all Google scripts | |
*/ | |
add_action( 'wp_enqueue_scripts', function() { | |
wp_register_script( 'google-ads-conversion', '//www.googleadservices.com/pagead/conversion.js' ); |