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 | |
/** | |
* @copyright Vanilla Forums Inc. | |
* @license GNU GPL2 | |
*/ | |
/** | |
* Instantiating this class will store current user's ID from cookie as $this->UserID. | |
* | |
* Usage |
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
/** | |
* Return a formated string from a date Object mimicking PHP's date() functionality | |
* | |
* format string "Y-m-d H:i:s" or similar PHP-style date format string | |
* date mixed Date Object, Datestring, or milliseconds | |
* | |
*/ | |
function date_format(format,date){ | |
if(!date || date === "") |
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 | |
use Automattic\WooCommerce\Admin\Features\ProductBlockEditor\ProductTemplates\GroupInterface; | |
add_filter( | |
'woocommerce_rest_prepare_product_object', | |
function ( $response, $post ) { | |
$custom_regular_prices_encoded = get_post_meta( $post->get_id(), '_custom_regular_prices', true ); | |
$custom_regular_prices = json_decode( |