Yoast\WP\SEO\Dashboard\Infrastructure\Endpoints

Readability_Scores_Endpoint{}Yoast 1.0

Represents the readability scores endpoint.

Хуков нет.

Использование

$Readability_Scores_Endpoint = new Readability_Scores_Endpoint();
// use class methods

Методы

  1. public get_name()
  2. public get_namespace()
  3. public get_route()
  4. public get_url()

Код Readability_Scores_Endpoint{} Yoast 24.4

class Readability_Scores_Endpoint implements Endpoint_Interface {

	/**
	 * Gets the name.
	 *
	 * @return string
	 */
	public function get_name(): string {
		return 'readabilityScores';
	}

	/**
	 * Gets the namespace.
	 *
	 * @return string
	 */
	public function get_namespace(): string {
		return Abstract_Scores_Route::ROUTE_NAMESPACE;
	}

	/**
	 * Gets the route.
	 *
	 * @throws Exception If the route prefix is not overwritten this throws.
	 * @return string
	 */
	public function get_route(): string {
		return Readability_Scores_Route::get_route_prefix();
	}

	/**
	 * Gets the URL.
	 *
	 * @return string
	 */
	public function get_url(): string {
		return \rest_url( $this->get_namespace() . $this->get_route() );
	}
}