This is a list of the SublimeText 2 addons I use for my development 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 | |
/** | |
* Plugin Name: WooCommerce Subscription Custom Interval | |
* Description: Add a custom 8 week subscription interval to WooCommerce Subscriptions | |
* Author: Brent Shepherd | |
* Version: 1.0 | |
* License: GPL v2 | |
*/ | |
function eg_add_custom_subscription_interval( $subscription_intervals ) { |
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_filter( 'woocommerce_dynamic_pricing_is_cumulative', 'wcdp_cumulative_pricing', 10, 2 ); | |
function wcdp_cumulative_pricing( $cumulative, $module_id ) { | |
if ( $module_id == 'advanced_category' || $module_id == 'simple_membership' ) { | |
$cumulative = true; | |
} | |
return $cumulative; | |
} | |
add_filter('wc_dynamic_pricing_load_modules', 'custom_dynamic_pricing_module_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
add_filter( 'woocommerce_dynamic_pricing_is_cumulative', 'wcdp_cumulative_pricing', 10, 2 ); | |
function wcdp_cumulative_pricing( $cumulative, $module_id ) { | |
if ( $module_id == 'simple_category' || $module_id == 'simple_membership' ) { | |
$cumulative = false; | |
} | |
return $cumulative; | |
} | |
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_filter('woocommerce_dynamic_pricing_is_cumulative', 'on_woocommerce_dynamic_pricing_is_cumulative', 10, 3); | |
function on_woocommerce_dynamic_pricing_is_cumulative($cumulative, $discounter_name, $cart_item) { | |
if ($discounter_name == 'simple_category' || $discounter_name == 'simple_membership') { | |
$cumulative = false; | |
} | |
return $cumulative; | |
} |
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( 'wooslider_slides_layout_html', 'wooslider_custom_content', 10, 3); | |
function wooslider_custom_content ( $content, $args, $post ) { | |
global $post; | |
$image = get_the_post_thumbnail( get_the_ID() ); | |
if ( 'true' == $args['link_slide'] || 1 == $args['link_slide'] ) { | |
$wooslider_url = get_post_meta( get_the_ID(), '_wooslider_url', 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
** | |
* Usage: | |
* Paste a gist link into a blog post or page and it will be embedded eg: | |
* https://gist.github.com/2926827 | |
* | |
* If a gist has multiple files you can select one using a url in the following format: | |
* https://gist.github.com/2926827?file=embed-gist.php | |
*/ | |
wp_embed_register_handler( 'gist', '/https:\/\/gist\.github\.com\/(\d+)(\?file=.*)?/i', 'wp_embed_handler_gist' ); |