PHP 클래스 RTMediaRouter, rtMedia

저자: Saurabh Shukla ([email protected])
파일 보기 프로젝트 열기: rtCamp/rtMedia

공개 프로퍼티들

프로퍼티 타입 설명
$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