Manages multiple hotels in a single website

author mcanever
version 1.0.0

 Methods

Disables the feature

disable() 
Static

Enable the feature

enable() 
Static

get_hotel()

get_hotel(string $post) : \Ambigous
Static

Parameters

$post

string

Returns

\Ambigous >

Retrieves the hotel post id

get_hotel_id(int | object $post, boolean $default_language) : int
Static

Parameters

$post

intobject

the post you want to check

$default_language

boolean

true if you want the id of the default language translation

Returns

intthe hotel post id

Retrieves the hotel slug

get_hotel_slug(string $post) 
Static

Parameters

$post

string

the slug

Retrieves the hotel title for the given $post

get_hotel_title(int | object $post) : string
Static

Parameters

$post

intobject

the post you want to know

Returns

stringthe hotel title

Get all Hotels in the current website

get_hotels() : array
Static

Returns

arraya list of posts that are main hotel page

Retrieves the hotels page ids

get_hotels_ids() : array
Static

Returns

arraylist of ids

Tests if the given $post is from the group website

is_group(int | object $post) : boolean
Static

Parameters

$post

intobject

the post you need to check, default is the current one

Returns

booleantrue if $post is from group website

Test if the given $post is from a single hotel

is_hotel(int | object $post, $hotel_name) : boolean
Static

Parameters

$post

intobject

the post you need to check, default is the current one

$hotel_name

Returns

booleantrue if $post is from the hotel website

Prints the HTML markup for the 'Is This An Hotel?' metabox

metabox_html($post) 
Static

Parameters

$post

Registers the 'Is This An Hotel?' metabox

register_metaboxes() 
Static

Saves the metabox data while saving the page

save_metabox_data($post_id) 
Static

Parameters

$post_id

Merges post anchestors and post id

get_haystack(object $post) : \array:
Static

Parameters

$post

object

Returns

\array:

 Properties

 

$enabled : \unknown
 

$hotels : array
 

$current_hotel : \Hotel
 

$errors : array

 Constants

 

Postmeta name to identify a single hotel

META_KEY_NAME : string