Video_Post::get_embed_options( bool $output = false )

Returns embed options for the post.


Parameters

$output

(Optional)

Default value: false


Return

(array|mixed|void)


Source

File: includes/libs/video-post.class.php

	public function get_embed_options( $output = false ){
		if( !$this->_post ){
			return;
		}
		/**
		 * @var Options
		 */
		$options_obj = Plugin::instance()->get_embed_options_obj();
		$override = $options_obj->get_option( 'allow_override' );

		if( !is_wp_error( $override ) && $override ){
			$options = $options_obj->get_options();
		}else{
			$options = $this->get_meta( $this->cpt()->get_post_settings()->get_meta_embed_settings() );
			foreach ( $options_obj->get_options() as $key => $value ){
				if( !isset( $options[ $key ] ) ){
					$options[ $key ] = $value;
				}
				// when values are in output booleans needs to be 0 or 1
				if( $output && is_bool( $value ) ){
					$options[ $key ] = absint( $options[ $key ] );
				}
			}
		}

		$options['size_ratio'] = false;
		if( $options_obj->get_option('aspect_override') ){
			$options['size_ratio'] = isset( $this->size['ratio'] ) ? $this->size['ratio'] : false;
		}

		return $options;
	}

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!