WP_REST_Controller::get_object_type() WordPress Method

The WP_REST_Controller::get_object_type() method is used to get the object type for a given controller.

WP_REST_Controller::get_object_type() #

Retrieves the object type this controller is responsible for managing.


Return

(string) Object type for the controller.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-controller.php

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

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

		return $schema['title'];
	}


Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.