WP_REST_Controller::get_object_type()protectedWP 4.7.0

Retrieves the object type this controller is responsible for managing.

Метод класса: WP_REST_Controller{}

Хуков нет.

Возвращает

Строку. Object type for the controller.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_object_type();

Список изменений

С версии 4.7.0 Введена.

Код WP_REST_Controller::get_object_type() WP 6.5.2

protected function get_object_type() {
	$schema = $this->get_item_schema();

	if ( ! $schema || ! isset( $schema['title'] ) ) {
		return null;
	}

	return $schema['title'];
}