This file contains hidden or 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_shortcode( 'kleo_search_form', 'kleo_search_form_func' ); | |
| function kleo_search_form_func( $atts, $content = null ) { | |
| $form_style = $type = $placeholder = $context = $el_class = ''; | |
| extract( shortcode_atts( array( | |
| 'form_style' => 'default', | |
| 'type' => 'both', | |
| 'context' => '', | |
| 'placeholder' => '', | |
| 'el_class' => '' |
This file contains hidden or 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
| // Shortcode For User Subscription Actions | |
| function cd_wcs_user_action_button( $atts ) { | |
| // Attributes | |
| $atts = shortcode_atts( | |
| array( | |
| 'user' => '', | |
| 'status' => 'active', | |
| 'button' => 'id', | |
| 'title' => '', |
This file contains hidden or 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
| /*-- Show Content Before Expiration Shortcode -----------------*/ | |
| function pmpro_before_expiration_shortcode( $atts, $content=null, $code="" ) { | |
| //make sure PMPro is active | |
| if(!function_exists('pmpro_getMembershipLevelForUser')) | |
| return; | |
| //get attributes | |
| $a = shortcode_atts( array( | |
| 'user' => '', | |
| 'days' => '15', |
This file contains hidden or 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
| /*-- Member Expiration Date Shortcode -----------------*/ | |
| //[pmpro_expiration_date] | |
| function pmpro_expiration_date_shortcode( $atts ) { | |
| //make sure PMPro is active | |
| if(!function_exists('pmpro_getMembershipLevelForUser')) | |
| return; | |
| //get attributes | |
| $a = shortcode_atts( array( | |
| 'user' => '', |
This file contains hidden or 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
| /*-- Smart Coupons By URL Integration --*/ | |
| add_action( 'cartflows_checkout_after_configure_cart', 'cartflows_smart_coupons_apply_coupon_from_url', 10, 1 ); | |
| function cartflows_smart_coupons_apply_coupon_from_url( $checkout_id ) { | |
| $cart = ( is_object( WC() ) && isset( WC()->cart ) ) ? WC()->cart : null; | |
| parse_str( wp_unslash( $_SERVER['QUERY_STRING'] ), $coupon_args ); // phpcs:ignore | |
| $coupon_args = wc_clean( $coupon_args ); | |
| // If Coupons are in URL |
This file contains hidden or 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
| //turn on @mentions for all users | |
| define( 'BP_MESSAGES_AUTOCOMPLETE_ALL', true ); | |
| /*---- Expand Auto Complete -------*/ | |
| //https://github.com/buddypress/BuddyPress/blob/fe47890c1ab7e2cb24c005f1c35fb9c6c8c8ab7c/src/bp-core/classes/class-bp-members-suggestions.php#L85 | |
| function bp_filter_buddypress_auto_complete( $args ) { | |
| $args['per_page'] = 100; | |
| // $args['populate_extras'] = true; | |
| //$args['search_terms'] = 'some term'; | |
| $args['search_wildcard'] = 'both'; |
This file contains hidden or 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
| /*-- BBpress User Favorites Shortcode [bbp-user-favorites] --*/ | |
| function bbp_user_favorites_shortcode( $atts ) { | |
| $user_id = get_current_user_id(); | |
| ob_start(); | |
| if ( bbp_get_user_favorites( $user_id ) ) { | |
| //bbp_get_template_part( 'pagination', 'topics' ); | |
| bbp_get_template_part( 'loop', 'topics' ); | |
| bbp_get_template_part( 'pagination', 'topics' ); | |
| } else { ?> | |
| <aside class="bp-feedback bp-messages info"> |
This file contains hidden or 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 | |
| /** | |
| * Core: Plugin Bootstrap | |
| * | |
| * @package AffiliateWP Leaderboard | |
| * @subpackage Core | |
| * @copyright Copyright (c) 2021, Sandhills Development, LLC | |
| * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
| * @since 1.1 | |
| */ |
This file contains hidden or 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
| /*-------------------------------------- | |
| Woocommerce - Disallow Guest Checkout on Certain products | |
| ----------------------------------------*/ | |
| // Display Guest Checkout Field | |
| add_action( 'woocommerce_product_options_general_product_data', 'woo_add_disable_gc_fields' ); | |
| function woo_add_disable_gc_fields() { | |
| global $woocommerce, $post; | |
| echo '<div class="options_group">'; |
This file contains hidden or 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
| //redirect any draft/trashed posts to custom postmeta field: redirect_url_on_draft | |
| add_action('wp', 'custom_redirect_on_draft'); | |
| function custom_redirect_on_draft(){ | |
| if ( !current_user_can( 'edit_pages' ) ) { | |
| if (is_404()){ | |
| global $wp_query, $wpdb; | |
| $page_id = $wpdb->get_var( $wp_query->request ); | |
| $post_status = get_post_status( $page_id ); | |
| $post_redirect = get_post_meta( $page_id, 'redirect_url_on_draft', true ); | |
| if(($post_status == 'trash' || $post_status == 'draft') && $post_redirect){ |