Yoast\WP\SEO\AI_Generator\Infrastructure\Endpoints

Get_Suggestions_Endpoint{}Yoast 1.0└─ Endpoint_Interface

Represents the setup steps tracking endpoint.

Хуков нет.

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

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

Методы

  1. public get_name()
  2. public get_namespace()
  3. public get_route()
  4. public get_url()
  5. public rest_url( $this->get_namespace() . $this->get_route() )
  6. ERROR: no method name found on line `return 'getSuggestions';`
  7. ERROR: no method name found on line `return Get_Suggestions_Route::ROUTE_NAMESPACE;`
  8. ERROR: no method name found on line `*/`
  9. ERROR: no method name found on line `return Get_Suggestions_Route::ROUTE_PREFIX;`
  10. ERROR: no method name found on line `*/`

Код Get_Suggestions_Endpoint{} Yoast 27.7

class Get_Suggestions_Endpoint implements Endpoint_Interface {

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

	/**
	 * Gets the namespace.
	 *
	 * @return string
	 */
	public function get_namespace(): string {
		return Get_Suggestions_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 Get_Suggestions_Route::ROUTE_PREFIX;
	}

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