Skip to content

Instantly share code, notes, and snippets.

// Sort by Popularity default in Category coupon page
add_action( 'init', function() {
remove_action( 'wpcoupon_coupon_category_before_sidebar', 'wpcoupon_coupon_cat_filter_box', 10 );
remove_filter( 'pre_get_posts', 'wpcoupon_coupon_cat_query' );
add_action( 'wpcoupon_coupon_category_before_sidebar', 'custom_wpcoupon_coupon_cat_filter_box', 10 );
add_filter( 'pre_get_posts', 'custom_wpcoupon_coupon_cat_query' );
} );
== Changelog ==
## 1.3.0
* FIXED: js error in page theme options.
## 1.2.9
* NEW: add option to show/hide the post meta on single post.
* NEW: add option to enable/disable group of expired coupons.
## 1.2.8
* NEW: add option to hide the "submit a coupon" on store page.
* NEW: support RTL for coupon slider & carousel.
* IMPROVED: Update a small typo issue.
/**
* Set Cookie
*
* @param cname
* @param cvalue
* @param exdays
*/
function setCookie( cname, cvalue, exdays ) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
@champsupertramp
champsupertramp / Ultimate Member - User meta shortcodes
Last active August 31, 2023 09:06
Ultimate Member - User meta shortcodes
/**
* Returns a user meta value
* Usage [um_user user_id="" meta_key="" ] // leave user_id empty if you want to retrive the current user's meta value.
* meta_key is the field name that you've set in the UM form builder
* You can modify the return meta_value with filter hook 'um_user_shortcode_filter__{$meta_key}'
*/
function um_user_shortcode( $atts ) {
$atts = extract( shortcode_atts( array(
'user_id' => get_current_user_id(),
'meta_key' => '',