Page

Functions


// Retrieve all pages
get_page();

// Retrieve page by slug = contact
get_page(['alias' => 'contact']);

mixed get_page ( $options = [] )
$options array
  • id (int/array) - page id
  • alias (string/array) - page slug
  • author (int/array) - page author
  • language (string/array) - page language
  • order (string) - page order (by default id ASC)
  • group_by (string) - group by
  • limit (int) - page limit
  • offset (int) - offset
  • page_status (int/array) - page status
  • with (string/array) - relations (available relations: author)
  • where (mixed) - additional condition, details
Returns array of Pages object collection or single Page object.

// Retrieve page by slug = contact
get_page_by(['alias', 'contact']);

mixed get_page_by ( $key, $value, $options = [] )
$key string
  • id - page id
  • alias - page slug
  • author - page author
  • language - page language
  • page_status - page status
$value mixed The value
$options array
  • id (int/array) - page id
  • alias (string/array) - page slug
  • author (int/array) - page author
  • language (string/array) - page language
  • order (string) - page order (by default id ASC)
  • group_by (string) - group by
  • limit (int) - page limit
  • offset (int) - offset
  • page_status (int/array) - page status
  • with (string/array) - relations (available relations: author)
  • where (mixed) - additional condition, details
Returns array of Page object collection or single Page object. On failure return an empty array and if value was the string or integer then returns null.
mixed get_home_page ( $options = [] )
$options array
  • id (int/array) - page id
  • alias (string/array) - page slug
  • author (int/array) - page author
  • language (string/array) - page language
  • order (string) - page order (by default id ASC)
  • group_by (string) - group by
  • limit (int) - page limit
  • offset (int) - offset
  • page_status (int/array) - page status
  • with (string/array) - relations (available relations: author)
  • where (mixed) - additional condition, details
Returns Home Page object.
update_page_counter ( $id, $count = 1 )
$id integer Page id
$count integer By default 1

Page Object

$id int Page id
$status int Page status
$title string Page title
$slug string Page slug
$content string Page content
$hits int Page view counter
$home int 1 - home page, 0 - none
$view string Page view
$version int Page version (update counter)
$reference mixed Page reference
$language string Page language
$created_by int Page author id
$created_at string Page created date
$modified_by int Page edited user id
$modified_at string Page edited date
$meta_title string Page meta title
$meta_keywords string Page meta keywords
$meta_description string Page meta description
$author object User object (relation)

User Object

$id int User id
$username string User username
$email string User email
$role string User role
$status int User status
$auth_key string User auth key
$password_hash string User password hash
$password_reset_token string User password reset token
$created_at string User created date
$profile object User profile (relation)
$posts object collection Related posts (relation)