PHP Класс RTMediaRouter, rtMedia

Автор: Saurabh Shukla ([email protected])
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$query_vars The query variables passed to our route
$slug The slug for the route

Открытые методы

Метод Описание
__construct ( string $slug = RTMEDIA_MEDIA_SLUG ) Initialise the route
is_template ( ) : boolean Checks if the route has been requested
rt_replace_the_content ( string $content = '' ) : mixed | string | void This fun little function fills up some WordPress globals with dummy data to stop your average page template from complaining about it missing.
rt_theme_compat_reset_post ( $args = [] )
set_query_vars ( ) Break the request URL into an array of variables after the route slug
slug ( string $slug ) Check if there is a constant defined for this route and use that instead So, this can be overridden by defining RTMEDIA_MEDIA_SLUG in wp-config.php
template_include ( string $template ) : string Hook into the template_include filter to load custom template files
template_redirect ( ) Hook into the template redirect action to populate the global objects

Описание методов

__construct() публичный Метод

Initialise the route
public __construct ( string $slug = RTMEDIA_MEDIA_SLUG )
$slug string The slug for which the route needs to be registered, for eg, /media/

is_template() публичный Метод

Checks if the route has been requested
public is_template ( ) : boolean
Результат boolean

rt_replace_the_content() публичный Метод

This fun little function fills up some WordPress globals with dummy data to stop your average page template from complaining about it missing.
public rt_replace_the_content ( string $content = '' ) : mixed | string | void
$content string
Результат mixed | string | void

rt_theme_compat_reset_post() публичный Метод

public rt_theme_compat_reset_post ( $args = [] )

set_query_vars() публичный Метод

Break the request URL into an array of variables after the route slug
public set_query_vars ( )

slug() публичный Метод

Check if there is a constant defined for this route and use that instead So, this can be overridden by defining RTMEDIA_MEDIA_SLUG in wp-config.php
public slug ( string $slug )
$slug string The slug string passed for the route, in the constructor

template_include() публичный Метод

Hook into the template_include filter to load custom template files
public template_include ( string $template ) : string
$template string Template file path of the default template
Результат string File path of the template file to be loaded

template_redirect() публичный Метод

Hook into the template redirect action to populate the global objects
public template_redirect ( )

Описание свойств

$query_vars публичное свойство

The query variables passed to our route
public $query_vars

$slug публичное свойство

The slug for the route
public $slug