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 | |
/** | |
* Filter Bookings discount rates | |
*/ | |
function prefix_discount_rates( $rates, $product_id ) { | |
$rates = array( | |
array( | |
'rate' => 3, | |
'after' => 10, | |
'from' => 'all' |
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
/* Disable checkboxes */ | |
.pewc-group-checkbox .pewc-item-field-wrapper { | |
pointer-events: none; | |
} |
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 | |
/** | |
* Display remaining quantity on Bookings page | |
*/ | |
function prefix_display_remaining_quantity() { | |
$remaining = bfwc_get_max_bookings( get_the_ID() ); | |
printf( | |
'Places remaining: %s', | |
$remaining | |
); |
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
/* Display field labels and values in columns */ | |
span.pewc-summary-panel-product-name { | |
width: 60%; | |
display: inline-block; | |
} | |
span.pewc-summary-panel-product-value { | |
display: inline-block; | |
width: 30%; | |
} | |
td.pewc-summary-panel-price { |
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 | |
/** | |
* Bypass all transients | |
*/ | |
add_filter( 'pewc_disable_all_transients', '__return_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_filter( 'unzip_file_use_ziparchive', '__return_false' ); |
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
<html> | |
<head> | |
<title>Product Add-Ons Ultimate REST API Tester</title> | |
</head> | |
<body> | |
<script src='wp-includes/js/jquery/jquery.min.js'></script> | |
<p>API Key: <input type="text" id="wc_api_key" value="" size="50"></p> | |
<p>API Secret: <input type="text" id="wc_api_secret" value="" size="50"></p> | |
<p>API Method: |
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 | |
/** | |
* Save cancelled roles field for variations | |
*/ | |
function prefix_save_product_variation( $variation_id, $index ) { | |
if( isset( $_POST['wcmo_product_sub_cancelled_roles'][$variation_id] ) ) { | |
update_post_meta( $variation_id, 'wcmo_product_sub_cancelled_roles', $_POST['wcmo_product_sub_cancelled_roles'][$variation_id] ); | |
} else { | |
delete_post_meta( $variation_id, 'wcmo_product_sub_cancelled_roles' ); |
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 | |
/** | |
* Filter restriction by page ID for user roles | |
*/ | |
function prefix_is_restricted_redirect( $is_restricted ) { | |
$restricted_page_ids = array( 2, 10 ); | |
if( is_page() ) { | |
$page_id = get_the_ID(); | |
if( in_array( $page_id, $restricted_page_ids ) ) { |
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 | |
/** | |
* Restrict access to pages by log-in status | |
*/ | |
function prefix_is_post_restricted( $is_restricted, $restricted_content ) { | |
// Edit the page IDs below | |
$restricted_page_ids = array( 2, 10 ); | |
if( is_page() ) { | |
$page_id = get_the_ID(); |