Rest_Api::register_field( array $object )

Post array returned by REST API


Parameters

$object

(array) (Required)


Return

(array|null)


Source

File: includes/libs/rest-api/rest-api.class.php

	public function register_field( $object ){
		$video = Helper::get_video_post( $object['id'] );
		$response = NULL;

		if( $video->is_video() ){
			$response = [
				'video_id'		=> $video->video_id,
				'uploader'		=> $video->uploader,
				'uploader_uri'	=> $video->uploader_uri,
				'published' 	=> $video->published,
				'_published'	=> $video->_published,
				'updated'		=> $video->updated,
				'title'			=> $video->title,
				'description' 	=> $video->description,
				'tags'			=> $video->tags,
				'duration'		=> $video->duration,
				'_duration'		=> $video->_duration,
				'thumbnails'	=> $video->thumbnails,
				'stats'			=> $video->stats,
				'privacy'		=> $video->privacy, // set by the plugin
				'view_privacy'	=> $video->view_privacy, // the original Vimeo privacy setting
				'embed_privacy' => $video->embed_privacy, // the original Vimeo privacy embed setting
				'size'			=> $video->size,
				// Vimeo on Demand
				'type' 	=> $video->type,
				'uri'	=> $video->uri,
				'link'	=> $video->link
			];
		}

		/**
		 * Run filter on returned result to allow third party to add additional fields.
		 *
		 * @param null|array $response  The returned fields that wil be added to Rest API.
		 * @param array $object         The queried object.
		 * @param Video_Post $video     The video post object.
		 */
		return apply_filters( 'vimeotheque\rest_api\fields', $response, $object, $video );
	}

Start your video site now!

Manage and coordinate your Vimeo channels, albums or videos with your WordPress website. Perfect fit for membership, portfolio, online courses or any type of video collection.

Get Vimeotheque PRO!