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
/** | |
* Use WC 2.0 variable price format, now include sale price strikeout | |
* | |
* @param string $price | |
* @param object $product | |
* @return string | |
*/ | |
function wc_wc20_variation_price_format( $price, $product ) { | |
// Main Price | |
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', 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
<?php | |
# Basic Usage | |
# requires that the user be logged in as an administrator and that a 'gwunrequire' parameter be added to the query string | |
# http://youurl.com/your-form-page/?gwunrequire=1 | |
new GWUnrequire(); | |
# Enable for All Users (Including Visitors) | |
# still requires the 'gwunrequire' parameter be added to the query string | |
new GWUnrequire( array( |
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( 'woocommerce_api_points_rewards_custom_generator', 'wc_points_rewards_generate_custom_points' ); | |
function wc_points_rewards_generate_custom_points() { | |
$customers = get_users( array( | |
'meta_key' => 'wc_points_balance' | |
) ); | |
foreach ( $customers as $customer ) { | |
$points = get_user_meta( $customer->ID, 'wc_points_balance', true ); | |
if ( $points > 0 ) { | |
if ( WC_Points_Rewards_Manager::increase_points( $customer->ID, $points, 'IMPORT' ) ) { |
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 | |
/** | |
* start the customisation | |
*/ | |
function custom_woo_before_shop_link() { | |
add_filter('woocommerce_loop_add_to_cart_link', 'custom_woo_loop_add_to_cart_link', 10, 2); | |
add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop'); | |
} | |
add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link'); |
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: Heartbeat API Demo | |
Plugin URI: http://www.strangerstudios.com/wp/heartbeat-api-demo | |
Description: Minimal example demonstrating the WordPress Heartbeat API being added in WP version 3.6. | |
Version: .1 | |
Author: strangerstudios | |
If logged in as a user and viewing the frontend of your website, | |
every 15 seconds you should see the following in your Javascript console: |
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 postcode requirement if billing or shipping country is Ireland | |
* Add to your theme functions.php file | |
*/ | |
add_action( 'woocommerce_checkout_process', 'custom_country_check' ); | |
function custom_country_check(){ | |
global $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
$.fn.typeahead.Constructor::render = (items) -> | |
items = $(items).map (i, item) => | |
i = $(@options.item).attr("data-value", item) | |
i.find("a").html @highlighter(item) | |
i[0] | |
@$menu.html items | |
this | |
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: Force SSL URL Scheme | |
Plugin URI: https://gist.github.com/webaware/4688802 | |
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work | |
Version: 1.0.0 | |
Author: WebAware | |
Author URI: http://webaware.com.au/ | |
@ref: http://wordpress.org/support/topic/ssl-insecure-needs-35-compatibility |
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 parse_message( &$tweet ) { | |
if ( !empty($tweet['entities']) ) { | |
$replace_index = array(); | |
$append = array(); | |
$text = $tweet['text']; | |
foreach ($tweet['entities'] as $area => $items) { | |
$prefix = false; | |
$display = false; | |
switch ( $area ) { | |
case 'hashtags': |