wpseo_init_rest_api() Yoast 1.0
Loads the rest api endpoints.
Хуков нет.
Возвращает
Null. Ничего.
Использование
wpseo_init_rest_api();
Код wpseo_init_rest_api() wpseo init rest api Yoast 15.6.2
function wpseo_init_rest_api() {
// We can't do anything when requirements are not met.
if ( ! WPSEO_Utils::is_api_available() ) {
return;
}
// Boot up REST API.
$configuration_service = new WPSEO_Configuration_Service();
$configuration_service->initialize();
$statistics_service = new WPSEO_Statistics_Service( new WPSEO_Statistics() );
$endpoints = [];
$endpoints[] = new WPSEO_Endpoint_File_Size( new WPSEO_File_Size_Service() );
$endpoints[] = new WPSEO_Endpoint_Statistics( $statistics_service );
foreach ( $endpoints as $endpoint ) {
$endpoint->register();
}
}