PHP Class Timber\Site

Inheritance: extends Core, implements Timber\CoreInterface
ファイルを表示 Open project: jarednova/timber Class Usage Examples

Public Properties

Property Type Description
$admin_email the admin email address set in the WP admin panel
$atom
$blogname
$charset string
$description string
$id the ID of a site in multisite
$language the language setting ex: en-US
$language_attributes of language attributes for usage in the tag
$multisite true if multisite, false if plain ole' WordPress
$name string
$pingback_url for people who like trackback spam
$rdf string
$rss
$rss2
$siteurl
$theme [TimberTheme](#TimberTheme)
$title string
$url

Public Methods

Method Description
__construct ( string | integer $site_name_or_id = null ) Constructs a TimberSite object
__get ( string $field ) : mixed
get_link ( ) : string
get_url ( ) : string
icon ( )
link ( ) : string Returns the link to the site's home.
meta ( $field )
update ( string $key, mixed $value )
url ( ) : string

Protected Methods

Method Description
icon_multisite ( $site_id )
init ( ) Executed for all types of sites: both multisite and "regular"
init_as_multisite ( integer $site_id )
init_as_singlesite ( ) Executed for single-blog sites
switch_to_blog ( string | integer | null $site_name_or_id ) : integer Switches to the blog requested in the request

Method Details

__construct() public method

Constructs a TimberSite object
public __construct ( string | integer $site_name_or_id = null )
$site_name_or_id string | integer

__get() public method

public __get ( string $field ) : mixed
$field string
return mixed

get_url() public method

Deprecation: 0.21.9
public get_url ( ) : string
return string

icon() public method

public icon ( )

icon_multisite() protected method

protected icon_multisite ( $site_id )

init() protected method

Executed for all types of sites: both multisite and "regular"
protected init ( )

init_as_multisite() protected method

protected init_as_multisite ( integer $site_id )
$site_id integer

init_as_singlesite() protected method

Executed for single-blog sites
protected init_as_singlesite ( )

meta() public method

public meta ( $field )

switch_to_blog() protected static method

Switches to the blog requested in the request
protected static switch_to_blog ( string | integer | null $site_name_or_id ) : integer
$site_name_or_id string | integer | null
return integer with the ID of the new blog

update() public method

public update ( string $key, mixed $value )
$key string
$value mixed

url() public method

See also: TimberSite::link
Deprecation: 1.0.4
public url ( ) : string
return string

Property Details

$admin_email public_oe property

the admin email address set in the WP admin panel
public $admin_email

$atom public_oe property

public $atom

$blogname public_oe property

public $blogname

$charset public_oe property

public string $charset
return string

$description public_oe property

public string $description
return string

$id public_oe property

the ID of a site in multisite
public $id

$language public_oe property

the language setting ex: en-US
public $language

$language_attributes public_oe property

of language attributes for usage in the tag
public $language_attributes

$multisite public_oe property

true if multisite, false if plain ole' WordPress
public $multisite

$name public_oe property

public string $name
return string

$pingback_url public_oe property

for people who like trackback spam
public $pingback_url

$rdf public_oe property

public string $rdf
return string

$rss public_oe property

public $rss

$rss2 public_oe property

public $rss2

$siteurl public_oe property

public $siteurl

$theme public_oe property

public [TimberTheme](#TimberTheme) $theme
return [TimberTheme](#TimberTheme)

$title public_oe property

public string $title
return string

$url public_oe property

public $url