Astra_Addon_Theme_Builder::register_routes()

Register API routes.


Description


Return

(void)


Source

File: addons/advanced-hooks/classes/class-astra-addon-theme-builder.php

		public function register_routes() {
			register_rest_route(
				'astra-addon/v1',
				'custom-layouts',
				array(
					array(
						'methods'             => WP_REST_Server::READABLE,
						'callback'            => array( $this, 'get_custom_layouts' ),
						'permission_callback' => array( $this, 'get_permissions_check' ),
						'args'                => array(),
					),
					'schema' => array( $this, 'get_public_item_schema' ),
				)
			);

			register_rest_route(
				'astra-addon/v1',
				'custom-layouts/(?P<id>\d+)',
				array(
					'methods'             => WP_REST_Server::DELETABLE,
					'callback'            => array( $this, 'delete_custom_layout' ),
					'permission_callback' => array( $this, 'delete_permissions_check' ),
					'args'                => array(
						'id' => array(
							'validate_callback' => 'rest_validate_request_arg',
							'required'          => true,
							'type'              => 'integer',
						),
					),
				)
			);
		}

Changelog

Changelog
Version Description
4.5.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.