SearchResultsShortcode
extends AbstractShortcode
in package
Table of Contents
- NONCE_ACTION = 'mphb-search-available-room'
- NONCE_NAME = 'mphb-search-available-room-nonce'
- $name : mixed
- $adults : int
- $attributes : array<string|int, mixed>
- $availableRoomsCount : array<string|int, mixed>
- $checkInDate : DateTime
- $checkOutDate : DateTime
- $children : int
- $errors : array<string|int, mixed>
- $isCorrectInputData : bool
- $isCorrectPage : bool
- $isShowDetails : bool
- $isShowExcerpt : bool
- $isShowFeaturedImage : bool
- $isShowGallery : bool
- $isShowPrice : bool
- $isShowTitle : bool
- $isShowViewButton : bool
- $isSortByPrice : bool
- $order : array<string|int, mixed>
- $stickedRoomType : int
- __construct() : mixed
- addActions() : mixed
- generateShortcode() : string
- getName() : mixed
- register() : mixed
- render() : mixed
- renderBookButton() : mixed
- renderRecommendation() : mixed
- renderReservationCart() : mixed
- setup() : mixed
- showErrorsMessage() : mixed
- stickRequestedRoomType() : mixed
- buildOrderQuery() : array<string|int, mixed>
- generateRecommmendation() : array<string|int, mixed>
- Generate basic naive recommendation
- getAvailableRoomTypes() : array<string|int, mixed>
- getRoomTypesQuery() : WP_Query
- mainLoop() : mixed
- parseAdults() : bool
- parseAttributes() : mixed
- parseCheckInDate() : bool
- parseCheckOutDate() : bool
- parseChildren() : bool
- parseInputData() : bool
- renderResultsInfo() : mixed
- renderRoomType() : mixed
- setupMatchedRoomTypes() : false|WP_Query
- setupSearchData() : mixed
Constants
NONCE_ACTION
public
mixed
NONCE_ACTION
= 'mphb-search-available-room'
NONCE_NAME
public
mixed
NONCE_NAME
= 'mphb-search-available-room-nonce'
Properties
$name
protected
mixed
$name
= 'mphb_search_results'
$adults
private
int
$adults
$attributes
private
array<string|int, mixed>
$attributes
= array()
$availableRoomsCount
private
array<string|int, mixed>
$availableRoomsCount
$checkInDate
private
DateTime
$checkInDate
$checkOutDate
private
DateTime
$checkOutDate
$children
private
int
$children
$errors
private
array<string|int, mixed>
$errors
= array()
$isCorrectInputData
private
bool
$isCorrectInputData
= false
$isCorrectPage
private
bool
$isCorrectPage
= false
$isShowDetails
private
bool
$isShowDetails
$isShowExcerpt
private
bool
$isShowExcerpt
$isShowFeaturedImage
private
bool
$isShowFeaturedImage
$isShowGallery
private
bool
$isShowGallery
$isShowPrice
private
bool
$isShowPrice
$isShowTitle
private
bool
$isShowTitle
$isShowViewButton
private
bool
$isShowViewButton
$isSortByPrice
private
bool
$isSortByPrice
= false
$order
private
array<string|int, mixed>
$order
= array()
$stickedRoomType
private
int
$stickedRoomType
Methods
__construct()
public
__construct() : mixed
Return values
mixed —addActions()
public
addActions() : mixed
Return values
mixed —generateShortcode()
public
generateShortcode([array<string|int, mixed> $attrs = array() ]) : string
Parameters
- $attrs : array<string|int, mixed> = array()
-
Attributes of shortcode
Return values
string —getName()
public
getName() : mixed
Return values
mixed —register()
public
register() : mixed
Return values
mixed —render()
public
render(mixed $atts, mixed $content, mixed $shortcodeName) : mixed
Parameters
- $atts : mixed
- $content : mixed
- $shortcodeName : mixed
Return values
mixed —renderBookButton()
public
renderBookButton() : mixed
Return values
mixed —renderRecommendation()
public
renderRecommendation(WP_Query $roomTypesQuery) : mixed
Parameters
- $roomTypesQuery : WP_Query
Return values
mixed —renderReservationCart()
public
renderReservationCart() : mixed
Return values
mixed —setup()
public
setup() : mixed
Return values
mixed —showErrorsMessage()
public
showErrorsMessage() : mixed
Return values
mixed —stickRequestedRoomType()
public
stickRequestedRoomType(array<string|int, WP_Post> $posts, WP_Query $wp_query) : mixed
Parameters
- $posts : array<string|int, WP_Post>
- $wp_query : WP_Query
Return values
mixed —buildOrderQuery()
protected
buildOrderQuery(array<string|int, mixed> $atts, array<string|int, mixed> $defaults) : array<string|int, mixed>
Parameters
- $atts : array<string|int, mixed>
-
Shortcode attributes.
- $defaults : array<string|int, mixed>
-
Default values of "orderby" and "order" attributes.
Tags
Return values
array<string|int, mixed> —generateRecommmendation()
Generate basic naive recommendation
private
generateRecommmendation(int $adults, int $children, array<string|int, mixed> $availableRooms[, bool $strict = false ]) : array<string|int, mixed>
Parameters
- $adults : int
- $children : int
- $availableRooms : array<string|int, mixed>
-
Room type ids as keys and rooms count as values.
- $strict : bool = false
-
Optional. Forbid incomplete allocation. Default FALSE.
Return values
array<string|int, mixed> —getAvailableRoomTypes()
private
getAvailableRoomTypes() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —of arrays [string $id, string $count]
getRoomTypesQuery()
private
getRoomTypesQuery() : WP_Query
Return values
WP_Query —mainLoop()
private
mainLoop() : mixed
Return values
mixed —parseAdults()
private
parseAdults(string|int $adults) : bool
Parameters
- $adults : string|int
Return values
bool —parseAttributes()
private
parseAttributes(mixed $attributes) : mixed
Parameters
- $attributes : mixed
Return values
mixed —parseCheckInDate()
private
parseCheckInDate(string $date) : bool
Parameters
- $date : string
-
Date in front date format
Return values
bool —parseCheckOutDate()
private
parseCheckOutDate(string $date) : bool
Parameters
- $date : string
-
Date in front date format
Return values
bool —parseChildren()
private
parseChildren(int|string $children) : bool
Parameters
- $children : int|string
Return values
bool —parseInputData()
private
parseInputData(mixed $input) : bool
Parameters
- $input : mixed
Return values
bool —renderResultsInfo()
private
renderResultsInfo(int $roomTypeCount) : mixed
Parameters
- $roomTypeCount : int
Return values
mixed —renderRoomType()
private
renderRoomType() : mixed
Return values
mixed —setupMatchedRoomTypes()
private
setupMatchedRoomTypes() : false|WP_Query
Return values
false|WP_Query —setupSearchData()
private
setupSearchData() : mixed