WP_REST_Menu_Items_Controller::get_schema_links() – Retrieve Link Description Objects that should be added to the Schema for the posts collection.

You appear to be a bot. Output may be restricted

Description

Retrieve Link Description Objects that should be added to the Schema for the posts collection.

Usage

$array = WP_REST_Menu_Items_Controller::get_schema_links();

Parameters

Returns

array

Source

File name: wordpress/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php


Lines:

1 to 20 of 20
  protected function get_schema_links() {
    $links   = parent::get_schema_links();
    $href    = rest_url( "{$this->namespace}/{$this->rest_base}/{id}" );
    $links[] = array(
      'rel'          => 'https://api.w.org/menu-item-object',
      'title'        => __( 'Get linked object.' ),
      'href'         => $href,
      'targetSchema' => array(
        'type'       => 'object',
        'properties' => array(
          'object' => array(
            'type' => 'integer',
          ),
        ),
      ),
    );

    return $links;
  }
 

 View on GitHub View on Trac