PHP Class RTMediaRouter, rtMedia

Author: Saurabh Shukla ([email protected])
Mostrar archivo Open project: rtCamp/rtMedia

Public Properties

Property Type Description
$query_vars The query variables passed to our route
$slug The slug for the route

Public Methods

Method Description
__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

Method Details

__construct() public method

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() public method

Checks if the route has been requested
public is_template ( ) : boolean
return boolean

rt_replace_the_content() public method

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
return mixed | string | void

rt_theme_compat_reset_post() public method

public rt_theme_compat_reset_post ( $args = [] )

set_query_vars() public method

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

slug() public method

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() public method

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
return string File path of the template file to be loaded

template_redirect() public method

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

Property Details

$query_vars public_oe property

The query variables passed to our route
public $query_vars

$slug public_oe property

The slug for the route
public $slug