wppaste
WordPress

WP_REST_Font_Faces_Controller

Source
wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php:13
Class to access font faces through the REST API.

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 2

Every hook that fires from inside WP_REST_Font_Faces_Controller, in the order it appears in the class, grouped by the method that fires it.

Properties · 1

$allow_batchfalseprotected
Whether the controller supports batching.

Methods · 22

Source code

class WP_REST_Font_Faces_Controller extends WP_REST_Posts_Controller { 	/**	 * The latest version of theme.json schema supported by the controller.	 *	 * @since 6.5.0	 * @var int	 */	const LATEST_THEME_JSON_VERSION_SUPPORTED = 3; 	/**	 * Whether the controller supports batching.	 *	 * @since 6.5.0	 * @var false	 */	protected $allow_batch = false; 	/**	 * Registers the routes for posts.	 *	 * @since 6.5.0	 *	 * @see register_rest_route()	 */	public function register_routes() {		register_rest_route(			$this->namespace,			'/' . $this->rest_base,			array(				'args'   => array(					'font_family_id' => array(						'description' => __( 'The ID for the parent font family of the font face.' ),						'type'        => 'integer',						'required'    => true,					),				),				array(					'methods'             => WP_REST_Server::READABLE,					'callback'            => array( $this, 'get_items' ),					'permission_callback' => array( $this, 'get_items_permissions_check' ),					'args'                => $this->get_collection_params(),				),				array(					'methods'             => WP_REST_Server::CREATABLE,					'callback'            => array( $this, 'create_item' ),					'permission_callback' => array( $this, 'create_item_permissions_check' ),					'args'                => $this->get_create_params(),				),				'schema' => array( $this, 'get_public_item_schema' ),			)		); 		register_rest_route(			$this->namespace,			'/' . $this->rest_base . '/(?P<id>[\d]+)',			array(				'args'   => array(					'font_family_id' => array(						'description' => __( 'The ID for the parent font family of the font face.' ),						'type'        => 'integer',						'required'    => true,					),					'id'             => array(						'description' => __( 'Unique identifier for the font face.' ),						'type'        => 'integer',						'required'    => true,					),				),				array(					'methods'             => WP_REST_Server::READABLE,					'callback'            => array( $this, 'get_item' ),					'permission_callback' => array( $this, 'get_item_permissions_check' ),					'args'                => array(						'context' => $this->get_context_param( array( 'default' => 'view' ) ),					),				),				array(					'methods'             => WP_REST_Server::DELETABLE,					'callback'            => array( $this, 'delete_item' ),

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.