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
/** | |
* Disable the Fixed Block Booking on the admin end. | |
*/ | |
function bkap_init_parameter_localize_script_booking_settings( $booking_settings ) { | |
if ( isset( $_GET['booking_post_id'] ) ) { | |
$booking_settings['booking_fixed_block_enable'] = ''; | |
$booking_settings['bkap_fixed_blocks_data'] = array(); | |
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
function enqueue_select2_scripts() { | |
wp_enqueue_script('select2-js', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js', array('jquery'), '4.0.13', true); | |
wp_enqueue_style('select2-css', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css', array(), '4.0.13'); | |
$custom_css = " | |
span.select2.select2-container { | |
width: 100% !important; | |
} | |
"; | |
wp_add_inline_style('select2-css', $custom_css); | |
wp_add_inline_script('select2-js', " |
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 | |
//Add a WooCommerce order status (completed, refunded) into the Dashboard status widget | |
function woocommerce_add_order_status_dashboard_widget() { | |
if ( ! current_user_can( 'edit_shop_orders' ) ) { | |
return; | |
} | |
$refunded_count = 0; | |
$completed_count = 0; | |
foreach ( wc_get_order_types( 'order-count' ) as $type ) { |
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 | |
// hide coupon field on the checkout page | |
function disable_coupon_field_on_checkout( $enabled ) { | |
if ( is_checkout() ) { | |
$enabled = false; | |
} | |
return $enabled; | |
} | |
add_filter( 'woocommerce_coupons_enabled', 'disable_coupon_field_on_checkout' ); |
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 | |
// hide coupon field on the cart page | |
function disable_coupon_field_on_cart( $enabled ) { | |
if ( is_cart() ) { | |
$enabled = false; | |
} | |
return $enabled; | |
} | |
add_filter( 'woocommerce_coupons_enabled', 'disable_coupon_field_on_cart' ); |