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 | |
function prefix_external_registration_approval_message( $message, $url, $user_id ) { | |
if( ! apply_filters( 'wcmo_allow_external_approval', false ) ) { | |
return $message; | |
} | |
$user_data = get_userdata( $user_id ); | |
$message .= '<p>User email: ' . $user_data->user_email . '</p>'; | |
return $message; |
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_filter( 'wcmo_allow_external_approval', '__return_true' ); |
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 | |
/** | |
* Get the user's location and populate the address | |
*/ | |
function prefix_created_customer( $user_id ) { | |
// Lcoation field ID | |
$field_id = '4171f87f'; | |
// Get the location |
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 | |
/** | |
* Apply the standard booking cost as a fixed cost to a booking, regardless of how long the booking is | |
*/ | |
function prefix_fixed_booking_cost( $booking_cost, $product_id ) { | |
$product = wc_get_product( $product_id ); | |
$booking_cost = floatval( bfwc_get_standard_cost( $product ) ); | |
return $booking_cost; | |
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 | |
function demo_close_accordion() { | |
return 'yes'; | |
} | |
add_filter( 'pewc_close_accordion', 'demo_close_accordion' ); |
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 | |
/** | |
* Query WordPress attachments with no alt text | |
* Automatically create alt text using file name | |
* Remove this snippet once you've run it | |
*/ | |
function pr_query_attachments() { | |
if( did_action( 'init' ) > 1 ) { | |
return; | |
} |
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 | |
/** | |
* Remove quantity input field in cart for specific products | |
*/ | |
function prefix_cart_item_quantity( $product_quantity, $cart_item_key ){ | |
$cart_item = WC()->cart->cart_contents[ $cart_item_key ]; | |
$product_id = $cart_item['data']->get_id(); | |
if( in_array( $product_id, array( 467, 789 ) ) ){ | |
$product_quantity = $cart_item['quantity']; | |
} |
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 div inside group wrapper | |
*/ | |
function prefix_open_group_inner( $group_id, $group, $group_index ) { | |
echo '<div class="my-group-inner">'; | |
} | |
add_action( 'pewc_open_group_inner', 'prefix_open_group_inner', 10, 4 ); | |
function prefix_close_group_inner( $group_id, $group, $group_index ) { |
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 | |
/** | |
* Filter group wrapper classes | |
* @param $classes Array | |
*/ | |
function prefix_filter_group_wrapper_class( $classes, $group_id, $group, $product_id ) { | |
$classes[] = 'my-new-group-class'; | |
return $classes; | |
} | |
add_filter( 'pewc_filter_group_wrapper_class', 'prefix_filter_group_wrapper_class', 10, 4 ); |
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 | |
/** | |
* Open a new div to wrap multiple groups | |
* Ensure you update the group ID | |
*/ | |
function prefix_open_group_wrapper( $group_id, $group, $group_index ) { | |
if( $group_id == 455 ) { | |
echo '<div class="my-group-wrapper">'; | |
} | |
} |