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
$coupon_code = 'UNIQUECODE'; // Code | |
$amount = '10'; // Amount | |
$discount_type = 'fixed_cart'; // Type: fixed_cart, percent, fixed_product, percent_product | |
$coupon = array( | |
'post_title' => $coupon_code, | |
'post_content' => '', | |
'post_status' => 'publish', | |
'post_author' => 1, | |
'post_type' => 'shop_coupon' |
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: Deactivate Certain Plugins - WPEngine Staging | |
Plugin URI: https://gist.github.com/subharanjanm/4272d25a446fb2ca12a549a4a5662633 | |
Description: Deactivate certain plugins in the development/staging environment of WP Engine. | |
Version: 1.0 | |
Author: Subharanjan | |
Author URI: https://gist.github.com/subharanjanm/4272d25a446fb2ca12a549a4a5662633 | |
License: GPLv2 | |
*/ |
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 Enable Reviews - Bulk Edit | |
* Description: Allow enable reviews by bulk edit into WooCommerce | |
* Version: 1.0.0 | |
* Author: Mário Valney | |
* Author URI: http://mariovalney.com | |
* Text Domain: woo-enable-reviews-bulk-edit | |
* |
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
<form action="<?php echo site_url() ?>/wp-admin/admin-ajax.php" method="POST" id="filter"> | |
<?php | |
if( $terms = get_terms( 'category', 'orderby=name' ) ) : | |
echo '<select name="categoryfilter"><option>Select category...</option>'; | |
foreach ( $terms as $term ) : | |
echo '<option value="' . $term->term_id . '">' . $term->name . '</option>'; | |
endforeach; | |
echo '</select>'; | |
endif; |
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
/* global wc_add_to_cart_params */ | |
(function($) { | |
$(function() { | |
if ( typeof wc_add_to_cart_params === 'undefined' ) { | |
return false; | |
} | |
$('.entry-summary form.cart').on('submit', function (e) { |
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_dropdown_variation_attribute_options_html', 'wc_dropdown_variation_attribute_options_sorted', 20, 2); | |
function wc_dropdown_variation_attribute_options_sorted( $html, $args ) { | |
$args = wp_parse_args( | |
apply_filters( 'woocommerce_dropdown_variation_attribute_options_args', $args ), | |
array( | |
'options' => false, | |
'attribute' => false, | |
'product' => false, |