<?php
namespace JET_ABAF;
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
class Advanced_Price_Rates {
/**
* Post meta key
*/
private $meta_key = 'jet_abaf_price';
private $post_meta = null;
private $rates = false;
public function __construct( $post_id, $post_meta = false ) {
$this->set_meta( $post_id, $post_meta );
}
/**
* Sets the post meta data for a given post.
*
* @since 2.2.5
* @since 4.1.0 Refactored.
*
* @param int $post_id The ID of the post.
* @param mixed $post_meta The meta data to set.
*
* @return void
*/
public function set_meta( $post_id, $post_meta ) {
$this->post_meta = $post_meta ?: get_post_meta( $post_id, $this->meta_key, true );
}
/**
* Retrieves the pricing rates associated with the current instance.
*
* @since 2.2.5
* @since 4.1.0 Refactored. Added `jet-booking/price/rates` hook.
*
* @return array The sorted and filtered list of pricing rates.
*/
public function get_rates() {
if ( false === $this->rates ) {
$pricing_rates = ! empty( $this->post_meta['_pricing_rates'] ) ? $this->post_meta['_pricing_rates'] : [];
usort( $pricing_rates, function ( $a, $b ) {
$a_duration = floatval( $a['duration'] );
$b_duration = floatval( $b['duration'] );
if ( $a_duration === $b_duration ) {
return 0;
}
return ( $a_duration < $b_duration ) ? - 1 : 1;
} );
$this->rates = apply_filters( 'jet-booking/price/rates', $pricing_rates, $this->post_meta, $this );
}
return $this->rates;
}
}
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| actions/ | 2026-07-21 14:16 | 3.54 KB | 76129f60960:kunden | dxwrx-r--r | |
| compatibility/ | 2026-07-21 14:16 | 102.94 KB | 76129f60960:kunden | dxwrx-r--r | |
| components/ | 2026-07-21 14:16 | 315.47 KB | 76129f60960:kunden | dxwrx-r--r | |
| cron/ | 2026-07-21 14:16 | 15.24 KB | 76129f60960:kunden | dxwrx-r--r | |
| dashboard/ | 2026-07-21 14:16 | 68.07 KB | 76129f60960:kunden | dxwrx-r--r | |
| db/ | 2026-07-21 14:16 | 44.01 KB | 76129f60960:kunden | dxwrx-r--r | |
| form-fields/ | 2026-07-21 14:16 | 4.28 KB | 76129f60960:kunden | dxwrx-r--r | |
| formbuilder-plugin/ | 2026-07-21 14:16 | 44.48 KB | 76129f60960:kunden | dxwrx-r--r | |
| framework/ | 2026-07-21 14:16 | 1.49 MB | 76129f60960:kunden | dxwrx-r--r | |
| macros/ | 2026-07-21 14:16 | 34.15 KB | 76129f60960:kunden | dxwrx-r--r | |
| multivendors/ | 2026-07-21 14:16 | 27 KB | 76129f60960:kunden | dxwrx-r--r | |
| render/ | 2026-07-21 14:16 | 16.17 KB | 76129f60960:kunden | dxwrx-r--r | |
| resources/ | 2026-07-21 14:16 | 28.38 KB | 76129f60960:kunden | dxwrx-r--r | |
| rest-api/ | 2026-07-21 14:16 | 35.46 KB | 76129f60960:kunden | dxwrx-r--r | |
| stores/ | 2026-07-21 14:16 | 4.32 KB | 76129f60960:kunden | dxwrx-r--r | |
| vendor/ | 2026-07-21 14:16 | 77.89 KB | 76129f60960:kunden | dxwrx-r--r | |
| visibility-conditions/ | 2026-07-21 14:16 | 3.69 KB | 76129f60960:kunden | dxwrx-r--r | |
| wc-integration/ | 2026-07-21 14:16 | 164.96 KB | 76129f60960:kunden | dxwrx-r--r | |
| workflows/ | 2026-07-21 14:16 | 34.38 KB | 76129f60960:kunden | dxwrx-r--r | |
| advanced-price-rates.php | 2026-07-21 14:16 | 1.5 KB | 76129f60960:kunden | -xw-x----- | |
| ajax-handlers.php | 2026-07-21 14:16 | 12.02 KB | 76129f60960:kunden | -xw-x----- | |
| apartment-booking-trait.php | 2026-07-21 14:16 | 8.27 KB | 76129f60960:kunden | -xw-x----- | |
| assets.php | 2026-07-21 14:16 | 6.3 KB | 76129f60960:kunden | -xw-x----- | |
| autoloader.php | 2026-07-21 14:16 | 1.49 KB | 76129f60960:kunden | -xw-x----- | |
| booking-functions.php | 2026-07-21 14:16 | 1.65 KB | 76129f60960:kunden | -xw-x----- | |
| capabilities.php | 2026-07-21 14:16 | 491 B | 76129f60960:kunden | -xw-x----- | |
| export.php | 2026-07-21 14:16 | 8.22 KB | 76129f60960:kunden | -xw-x----- | |
| google-calendar.php | 2026-07-21 14:16 | 5.88 KB | 76129f60960:kunden | -xw-x----- | |
| ical.php | 2026-07-21 14:16 | 19.35 KB | 76129f60960:kunden | -xw-x----- | |
| plugin.php | 2026-07-21 14:16 | 7.35 KB | 76129f60960:kunden | -xw-x----- | |
| price.php | 2026-07-21 14:16 | 13.4 KB | 76129f60960:kunden | -xw-x----- | |
| seasonal-price.php | 2026-07-21 14:16 | 1.54 KB | 76129f60960:kunden | -xw-x----- | |
| set-up.php | 2026-07-21 14:16 | 7.21 KB | 76129f60960:kunden | -xw-x----- | |
| settings.php | 2026-07-21 14:16 | 32.28 KB | 76129f60960:kunden | -xw-x----- | |
| statuses.php | 2026-07-21 14:16 | 3.05 KB | 76129f60960:kunden | -xw-x----- | |
| tools.php | 2026-07-21 14:16 | 31.31 KB | 76129f60960:kunden | -xw-x----- | |
| upgrade.php | 2026-07-21 14:16 | 11.17 KB | 76129f60960:kunden | -xw-x----- | |
| weekend-price.php | 2026-07-21 14:16 | 1.17 KB | 76129f60960:kunden | -xw-x----- | |