Title: WP_REST_Controller::get_public_item_schema
Published: December 6, 2016
Last modified: May 20, 2026

---

# WP_REST_Controller::get_public_item_schema(): array

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_controller/get_public_item_schema/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_controller/get_public_item_schema/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_controller/get_public_item_schema/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_controller/get_public_item_schema/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_rest_controller/get_public_item_schema/?output_format=md#wp--skip-link--target)

Retrieves the item’s schema for display / public consumption purposes.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_rest_controller/get_public_item_schema/?output_format=md#return)󠁿

 array Public item schema data.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_controller/get_public_item_schema/?output_format=md#source)󠁿

    ```php
    public function get_public_item_schema() {

    	$schema = $this->get_item_schema();

    	if ( ! empty( $schema['properties'] ) ) {
    		foreach ( $schema['properties'] as &$property ) {
    			unset( $property['arg_options'] );
    		}
    	}

    	return $schema;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php#L321)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php#L321-L332)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_rest_controller/get_public_item_schema/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_REST_Controller::get_item_schema()](https://developer.wordpress.org/reference/classes/wp_rest_controller/get_item_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-controller.php` |

Retrieves the item’s schema, conforming to JSON Schema.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_rest_controller/get_public_item_schema/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_rest_controller%2Fget_public_item_schema%2F)
before being able to contribute a note or feedback.