MPHB_PLUGIN_FILE
public
mixed
MPHB_PLUGIN_FILE
= __FILE__
public
mixed
MPHB_PLUGIN_FILE
= __FILE__
Get template part.
mphb_get_template_part(string $slug[, mixed $atts = array() ]) : mixed
mphb_load_template(mixed $template[, mixed $templateArgs = array() ]) : mixed
mphb_current_time(string $type, bool $gmt) : string
Retrieve a post status label by name
mphb_get_status_label(string $status) : string
mphb_set_cookie(string $name, string $value, int $expire) : mixed
mphb_get_cookie(string $name) : mixed|null
mphb_has_cookie(string $name) : bool
mphb_unset_cookie(string $name) : mixed
mphb_is_checkout_page() : mixed
mphb_is_search_results_page() : mixed
mphb_is_single_room_type_page() : mixed
mphb_is_create_booking_page() : mixed
mphb_get_thumbnail_width() : mixed
mphb_format_price(float $price[, array<string|int, mixed> $atts = array() ]) : string
mphb_format_percentage(float $price[, array<string|int, mixed> $atts = array() ]) : string
Trim trailing zeros off prices.
mphb_trim_zeros(mixed $price) : string
mphb_trim_decimal_zeros(mixed $price) : mixed
Get WP Query paged var
mphb_get_paged_query_var() : int
mphb_add_to_meta_query(array<string|int, mixed> $queryPart, array<string|int, mixed>|null $metaQuery) : array<string|int, mixed>
mphb_meta_query_is_first_order_clause(array<string|int, mixed> $query) : bool
Clean variables using sanitize_text_field. Arrays are cleaned recursively.
mphb_clean(string|array<string|int, mixed> $var) : string|array<string|int, mixed>
Non-scalar values are ignored.
mphb_hash_equals(string $knownString, string $userInput) : bool
mphb_strlen(string $s) : string
TODO add support for arrays
mphb_get_query_args(string $url) : array<string|int, mixed>
Wrapper function for wp_dropdown_pages
mphb_wp_dropdown_pages([array<string|int, mixed> $atts = array() ]) : string
Wrapper for set_time_limit to see if it is enabled.
mphb_set_time_limit(int $limit) : mixed
The maximum execution time, in seconds. If set to zero, no time limit is imposed.
mphb_error_log(mixed $message) : mixed
mphb_current_domain() : string
For local usage only. For global IDs it's better to use function mphb_generate_uid().
mphb_generate_uuid4() : string
mphb_generate_uid() : mixed
Retrieves the edit post link for post regardless current user capabilities
mphb_get_edit_post_link_for_everyone(int|string $id[, mixed $context = 'display' ]) : string
mphb_get_rooms_select_list(int $typeId) : array<string|int, mixed>
Room type ID.
mphb_show_multiple_instances_notice() : mixed
mphb_upgrade_to_premium_message([string $wrapper = 'span' ][, string $wrapperClass = 'description' ]) : string
Optional. Wrapper tag - "span" or "div". "span" by default. Pass the empty value to remove the wrapper
Optional. "description" by default.
Season price format history: v2.6.0- - single number.
mphb_normilize_season_price(mixed $price) : array<string|int, mixed>
v2.7.1- - ["base", "enable_variations" => "0"|"1", "variations" => ""|[["adults", "children", "price"]]]. v2.7.2+ - ["periods", "prices", "enable_variations" => true/false, "variations" => [["adults", "children", "prices"]]].
Price in any format.
Check if term name is reserved.
mphb_is_reserved_term(string $termName) : bool
Term name.
mphb_string_starts_with(string $haystack, string $needle) : bool
mphb_string_ends_with(string $haystack, string $needle) : bool
mphb_array_disjunction(mixed $a, mixed $b) : mixed
mphb_readable_post_statuses() : array<string|int, mixed>
mphb_db_version() : mixed
mphb_db_version_at_least(mixed $requiredVersion) : mixed
mphb_version_at_least(mixed $requiredVersion) : mixed
mphb_wordpress_at_least(string $requiredVersion) : bool
mphb_fix_blocks_autop() : mixed
mphb_escape_json_unicodes(string $json) : string
JSON string with possibly escaped Unicode symbols (\uXXXX).
mphb_strip_price_breakdown_json(string $json) : string
JSON string with possibly escaped symbol '.
mphb_uploads_dir() : string
mphb_create_uploads_dir() : mixed
mphb_verify_nonce(mixed $action[, mixed $nonceName = 'mphb_nonce' ]) : mixed
mphb_get_polyfill_for(mixed $function) : mixed
mphb_current_year() : int
mphb_days_in_month(int $month, int $year) : int
mphb_get_customer_fields() : array<string|int, mixed>
mphb_get_default_customer_fields() : array<string|int, mixed>
mphb_is_default_customer_field(string $fieldName) : bool
mphb_get_custom_customer_fields() : array<string|int, mixed>
mphb_get_admin_checkout_customer_fields() : array<string|int, mixed>
mphb_get_editing_post_id() : int
mphb_limit(int|float $value, int|float $min, int|float $max) : int|float
Add an array after the specified position.
mphb_array_insert_after(array<string|int, mixed> $array, int $position, array<string|int, mixed> $insert) : array<string|int, mixed>
Subject array.
Array to insert.
Add an array after the specified key in the associative array.
mphb_array_insert_after_key(array<string|int, mixed> $array, mixed $searchKey, array<string|int, mixed> $insert) : array<string|int, mixed>
Subject array.
Array to insert.
mphb_array_usearch(array<string|int, mixed> $haystack, callable $checkCallback) : mixed
The callback check function. The function must return TRUE if the proper element was found or FALSE otherwise. Gets the value of the element as the first argument and the key as second.
mphb_prefix(string $str[, string $separator = '_' ]) : string
Optional. "_" by default.
mphb_unprefix(string $str[, string $separator = '_' ]) : string
Optional. "_" by default.
mphb_get_booking(int $bookingId[, bool $force = false ]) : Booking|null
Optional. FALSE by default.
mphb_get_customer(int $bookingId) : Customer|null
mphb_get_room_type(int $roomTypeId[, bool $force = false ]) : RoomType|null
Optional. FALSE by default.
mphb_get_season(int $seasonId[, bool $force = false ]) : Season|null
Optional. False by default.
Determine if the current view is the "All" view.
mphb_is_base_request([string|null $postType = null ]) : bool
Optional. NULL by default.
mphb_is_complete_booking(Booking $booking) : bool
mphb_is_pending_booking(Booking $booking) : bool
mphb_is_locking_booking(Booking $booking) : bool
mphb_is_failed_booking(Booking $booking) : bool
mphb_get_available_rooms(DateTime $from, DateTime $to[, array<string|int, mixed> $atts = array() ]) : array<string|int, mixed>
Start date, like check-in date.
End date, like check-out date.
Optional. @param int $atts['room_type_id'] Optional. 0 by default (any room type). @param int|int[] $atts['exclude_bookings'] Optional. One or more booking IDs.
mphb_posint(int|string $value) : int
mphb_get_min_adults() : int
mphb_get_min_children() : int
mphb_get_max_adults() : int
mphb_get_max_children() : int
mphb_array_flip_duplicates(array<string|int, mixed> $array[, bool $arraySingle = false ]) : array<string|int, mixed>
Array to flip.
Optional. Convert single value into array. FALSE by default.
mphb_get_room_type_base_price([mixed $roomType = null ][, mixed $startDate = null ][, mixed $endDate = null ]) : float
mphb_get_room_type_period_price(DateTime $startDate, DateTime $endDate[, mixed $roomType = null ][, array<string|int, mixed> $args = array() ]) : float
Optional.
mphb_get_room_type_ids([string $language = 'any' ][, array<string|int, mixed> $atts = array() ]) : array<string|int, int>
'any'|'original' Optional. 'any' by default.
Additional atts.
mphb_today([string $modifier = '' ]) : DateTime
Optional. Modifier like '+1 day'. Empty by default.
mphb_has_buffer_days() : bool
mphb_get_buffer_days(DateTime $date, int $roomTypeId) : int
mphb_modify_buffer_period(DateTime $startDate, DateTime $endDate, int $bufferDays) : array<string|int, DateTime>
mphb_modify_booking_buffer_period(Booking $booking, int $bufferDays[, bool $extendDates = false ]) : array<string|int, DateTime>
Optional. Extend the final result with check-in and next to the check-out dates. Useful for Booking Calendar, for example. False by default.
mphb_modify_booking_period_with_booking_buffer(array<string|int, mixed> $bookingPeriod, int $roomTypeId) : array<string|int, DateTime>
mphb_is_rooms_free_query_atts_with_buffer(array<string|int, mixed> $atts) : array<string|int, mixed>
mphb_filter_checkin_checkout_dates(array<string|int, mixed> $datesArray, int $roomsTotal) : array<string|int, mixed>
Display a help tip.
mphb_help_tip(string $tip[, bool $allow_html = false ]) : string
Help tip text.
Allow sanitized HTML if true or escape.
mphb_create_url(string $endpoint[, string $value = '' ][, string $permalink = '' ]) : string
Endpoint slug.
Query param value.
Permalink.
mphb_parse_queue_room_id(string $queueItem) : int
Sync queue item, like "%Timestamp%_%Room ID%".
mphb_add_attribute(mixed $attribute) : mixed
mphb_attribute_exists(mixed $attributeName) : mixed
This function generates taxonomy name or gets the registered one.
mphb_attribute_taxonomy_name(string $attributeName) : string
mphb_taxonomy_attribute_name(mixed $taxonomyName) : mixed
mphb_is_attribute_taxonomy(mixed $taxonomyName) : mixed
mphb_is_attribute_taxonomy_edit_page() : mixed
mphb_is_duplicate_attribute(mixed $attributeName) : mixed
mphb_has_duplicate_attributes(mixed $attributeName) : mixed
mphb_attributes_prefix() : mixed
mphb_get_attribute_names() : mixed
mphb_sanitize_attribute_name(mixed $attributeName) : mixed
mphb_clean_attribute_name(mixed $attributeName) : mixed
mphb_attribute_title(mixed $attributeName) : mixed
mphb_is_public_attribute(mixed $attributeName) : mixed
mphb_is_visible_attribute(mixed $attributeName) : mixed
mphb_attribute_orderby(mixed $attributeName) : mixed
mphb_attribute_default_text(string $attributeName) : string
Note: this will reset order for all terms in range [1; oo) after first reorder.
mphb_reorder_attributes(int $currentId, int $nextId, string $taxonomyName) : mixed
mphb_set_attribute_order(mixed $termId, mixed $index, mixed $taxonomyName) : mixed
mb_convert_encoding(mixed $s, mixed $toEncoding[, mixed $fromEncoding = null ]) : mixed
mb_convert_encoding_callback(mixed $m) : mixed
mb_detect_encoding(mixed $s[, mixed $encodings = null ][, mixed $strict = false ]) : mixed
mb_validate_encoding(mixed $encoding) : mixed
MPHB() : HotelBookingPlugin
Display the room type default (average minimal) price for min days stay
mphb_tmpl_the_room_type_default_price([int $id = null ]) : mixed
Optional. Current room type by default.
mphb_tmpl_has_room_type_default_price([int $id = null ]) : bool
Optional. Current room type by default.
Display the room type minimal price for dates
mphb_tmpl_the_room_type_price_for_dates(DateTime $checkInDate, DateTime $checkOutDate) : string
Retrieve dayname for key
mphb_tmpl_get_day_by_key(string|int $key) : string
number from 0 to 6
mphb_tmpl_get_room_type_total_capacity() : int
Retrieve the room type adults capacity
mphb_tmpl_get_room_type_adults_capacity() : int
Retrieve the room type children capacity
mphb_tmpl_get_room_type_children_capacity() : int
Retrieve the room type bed type
mphb_tmpl_get_room_type_bed_type() : string
Retrieve the room type facilities
mphb_tmpl_get_room_type_facilities() : array<string|int, mixed>
Retrieve the room type attributes
mphb_tmpl_get_room_type_attributes() : array<string|int, mixed>
Retrieve the room type size
mphb_tmpl_get_room_type_size([ $withUnits = true ]) : string
Retrieve the room type categories
mphb_tmpl_get_room_type_categories() : array<string|int, mixed>
Retrieve the room type view
mphb_tmpl_get_room_type_view() : string
Check is current room type has gallery.
mphb_tmpl_has_room_type_gallery() : bool
mphb_tmpl_get_room_type_gallery_ids([bool $withFeaturedImage = false ]) : array<string|int, mixed>
mphb_tmpl_the_room_type_galery([array<string|int, mixed> $atts = array() ]) : mixed
@see gallery_shortcode
mphb_tmpl_the_single_room_type_gallery() : mixed
mphb_tmpl_the_room_type_flexslider_gallery() : mixed
mphb_the_flexslider_gallery(array<string|int, int> $ids, array<string|int, mixed> $atts[, array<string|int, mixed> $flexsliderAtts = array() ]) : mixed
Id of attachments
mphb_tmpl_the_room_type_featured_image() : mixed
Retrieve single room type featured image
mphb_tmpl_get_room_type_image([mixed $postID = null ][, string $size = null ]) : string
Optional. Size of image.
Retrieve in-loop room type thumbnail
mphb_tmpl_the_loop_room_type_thumbnail([string $size = null ]) : mixed
mphb_tmpl_the_loop_room_type_book_button([string $buttonText = null ]) : mixed
mphb_tmpl_the_loop_room_type_book_button_form([string $buttonText = null ]) : mixed
mphb_tmpl_the_loop_room_type_view_details_button([string $buttonText = null ]) : mixed
Display room type calendar
mphb_tmpl_the_room_type_calendar(mixed $roomTypeId[, mixed $monthsToShow = '' ][, mixed $isShowPrices = false ][, mixed $isTruncatePrices = true ][, mixed $isShowPricesCurrency = false ]) : mixed
Display room type reservation form
mphb_tmpl_the_room_reservation_form(mixed $roomTypeId) : mixed
Retrieve in-loop service thumbnail
mphb_tmpl_the_loop_service_thumbnail([string $size = null ]) : mixed
mphb_tmpl_the_service_price() : mixed
Retrieve the classes for the post div as an array.
mphb_tmpl_get_filtered_post_class([string|array<string|int, mixed> $class = '' ][, mixed $postId = null ]) : array<string|int, mixed>
One or more classes to add to the class list.
mphb_tmpl_the_reserved_rooms_details(array<string|int, ReservedRoom> $reservedRooms) : mixed
mphb_tmpl_the_payments_table(Booking $booking) : mixed
mphb_tmpl_select_html(mixed $args, mixed $options, mixed $selected) : mixed
mphb_tmpl_multicheck_html(mixed $name, mixed $options, mixed $selected) : mixed
mphb_tmpl_render_select(array<string|int, mixed> $options, mixed $selected[, array<string|int, mixed> $atts = array() ]) : string
Optional.
mphb_tmpl_render_select_options(array<string|int, mixed> $options, mixed $selected) : string
mphb_tmpl_render_atts(array<string|int, mixed> $atts) : string
mphb_tmpl_the_room_type_price_for_dates_output(mixed $price, mixed $taxesAndFees, mixed $atts) : mixed
mphb_tmpl_the_total_recommended_price_for_dates_output(mixed $totalHtml, mixed $taxesAndFees, mixed $atts) : mixed
mphb_recommended_room_types_items_for_dates_output(mixed $price, mixed $taxesAndFees) : mixed
renderTaxesAndFeesOutput(mixed $taxesAndFees[, mixed $paragraph = true ]) : mixed
mphb_tax_price_classes(mixed $classes) : mixed