Свойство | Type | Description | |
---|---|---|---|
$data | array | Mapping data | |
$site | integer | Site ID |
Méthode | Description | |
---|---|---|
__clone ( ) | Clone magic method when clone( self ) is called. | |
create ( string $site, string $domain, boolean $active = false ) : |
Create a new domain mapping | |
delete ( ) : boolean | WP_Erro\WP_Error | Delete the mapping | |
get ( integer | |
Get mapping by mapping ID | |
get_by_domain ( string | array $domains ) : |
Get mapping by domain(s) | |
get_by_site ( integer | stdClass $site ) : |
Get mapping by site ID | |
get_domain ( ) : string | Get the domain from the mapping | |
get_id ( ) : integer | Get mapping ID | |
get_site ( ) : stdClass | boolean | Get site object | |
get_site_id ( ) : integer | Get site ID | |
is_active ( ) : boolean | Is the mapping active? | |
make_primary ( ) : boolean | WP_Error | Make this mapping the primary domain, eg. set the homeurl for the site | |
set_active ( boolean $active ) : boolean | WP_Erro\WP_Error | Set whether the mapping is active | |
set_domain ( string $domain ) : boolean | WP_Erro\WP_Error | Set the domain for the mapping | |
update ( array | stdClass $data ) : boolean | WP_Erro\WP_Error | Update the mapping |
Méthode | Description | |
---|---|---|
__construct ( array $data ) | Constructor | |
to_instance ( stdClass $data ) : |
Convert data to Mapping instance | |
to_instances ( stdClass[] $data ) : |
Convert list of data to Mapping instances |
public __clone ( ) |
protected __construct ( array $data ) | ||
$data | array | Mapping data |
public static get_by_site ( integer | stdClass $site ) : |
||
$site | integer | stdClass | Site ID, or site object from {@see \get_blog_details} |
Résultat | Mapping on success, WP_Error if error occurred, or null if no mapping found |
public get_domain ( ) : string | ||
Résultat | string |
public make_primary ( ) : boolean | WP_Error | ||
Résultat | boolean | WP_Error | True if we created the old mapping or WP_Error if an error occurred |
public set_active ( boolean $active ) : boolean | WP_Erro\WP_Error | ||
$active | boolean | Should the mapping be active? (True for active, false for inactive) |
Résultat | boolean | WP_Erro\WP_Error | True if we updated, false if we didn't need to, or WP_Error if an error occurred |
public set_domain ( string $domain ) : boolean | WP_Erro\WP_Error | ||
$domain | string | Domain name |
Résultat | boolean | WP_Erro\WP_Error | True if we updated, false if we didn't need to, or WP_Error if an error occurred |
protected static to_instance ( stdClass $data ) : |
||
$data | stdClass | Raw mapping data |
Résultat |
protected static to_instances ( stdClass[] $data ) : |
||
$data | stdClass[] | Raw mapping rows |
Résultat |