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
/** | |
* Convert milliseconds to the desired format | |
* @param milliseconds | |
* @param format | |
* @returns {*} | |
* @see https://gist.github.com/flangofas/714f401b63a1c3d84aaa | |
*/ | |
function convertMilliseconds(milliseconds, format) { | |
var total_days, total_hours, total_minutes, total_seconds; |
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
/** | |
* Widget areas | |
* | |
* @package WordPress | |
* @subpackage Promo Printing | |
* @since Promo Printing 1.0 | |
*/ | |
if (class_exists('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
<?php | |
/** | |
* Get all groups | |
* Utility function | |
* @author Antonio Blanco | |
* @see https://github.com/eggemplo/Groups-Utilities/blob/master/get_groups.php | |
*/ | |
function doublee_get_all_groups() { | |
global $wpdb; | |
$groups_table = _groups_get_tablename('group'); |
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 reCaptcha to checkout form | |
* Note: Can't place within the payment part of the form, WooCommerce just won't show it, choose an appropriate action to add it to accordingly | |
* @param $checkout | |
*/ | |
function doublee_show_me_the_checkout_captcha($checkout) { | |
echo '<div class="g-recaptcha" data-sitekey="YOUR_KEY_HERE"></div>'; | |
} | |
add_action('woocommerce_checkout_order_review', 'doublee_show_me_the_checkout_captcha', 18); |
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 | |
/** | |
* Archive filter queries using the drop-downs on each archive | |
* | |
* @see filters.php | |
* @param $query | |
*/ | |
function wh_filter_archives($query) { | |
// Do not modify queries in the admin |
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
// Note: This assumes you already have the CSS set up for the classes you want to use. | |
function initCarousel() { | |
$('.my-carousel').slick({ | |
slidesToShow: 1, | |
slidesToScroll: 1, | |
autoplay: false, | |
adaptiveHeight: false, | |
fade: 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 | |
/** | |
* Add base tier option to Advanced tab of subscription product | |
*/ | |
function doublee_subscription_product_advanced_settings() { | |
$product = wc_get_product(get_the_id()); | |
if($product->get_type() === 'variable-subscription') { | |
$variations = $product->get_available_variations(); | |
$variation_options = array(); | |
foreach ($variations as $variation) { |
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 custom columns in Users area in the CMS | |
* @param $columns | |
* | |
* @return mixed | |
*/ | |
function doublee_manage_users_columns($columns) { | |
$columns['join_date'] = 'Join date'; |