BP_REST_Activity_Link_Preview_Endpoint::register_routes()

Register the component routes.

Description

Source

File: bp-activity/classes/class-bp-rest-activity-link-preview-endpoint.php

	public function register_routes() {
		register_rest_route(
			$this->namespace,
			'/' . $this->rest_base . '/link-preview',
			array(
				'args'   => array(
					'url' => array(
						'description' => __( 'URL for the generate link preview.', 'buddyboss' ),
						'type'        => 'string',
						'required'    => true,
					),
				),
				array(
					'methods'             => WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_items' ),
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
				),
				'schema' => array( $this, 'get_item_schema' ),
			)
		);
	}

Changelog

Changelog
Version Description
0.1.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.