Yoast\WP\SEO\Dashboard\Infrastructure\Endpoints
SEO_Scores_Endpoint{}└─ Dashboard_Endpoint_Interface
Represents the SEO scores endpoint.
Хуков нет.
Использование
$SEO_Scores_Endpoint = new SEO_Scores_Endpoint(); // use class methods
Методы
- public get_name()
- public get_namespace()
- public get_route()
- public get_url()
Код SEO_Scores_Endpoint{} SEO Scores Endpoint{} Yoast 27.4
class SEO_Scores_Endpoint implements Dashboard_Endpoint_Interface {
/**
* Gets the name.
*
* @return string
*/
public function get_name(): string {
return 'seoScores';
}
/**
* Gets the namespace.
*
* @return string
*/
public function get_namespace(): string {
return Abstract_Scores_Route::ROUTE_NAMESPACE;
}
/**
* Gets the route.
*
* @return string
*
* @throws Exception If the route prefix is not overwritten this throws.
*/
public function get_route(): string {
return SEO_Scores_Route::get_route_prefix();
}
/**
* Gets the URL.
*
* @return string
*/
public function get_url(): string {
return \rest_url( $this->get_namespace() . $this->get_route() );
}
}