Classic_Editor::post_thumbnail_meta_panel( $content,  $post_id )

Manipulate output for featured image on custom post to allow importing of thumbnail as featured image


Parameters

$content

(Required)

$post_id

(Required)


Return

(string)


Source

File: includes/libs/admin/editor/classic-editor.class.php

	public function post_thumbnail_meta_panel( $content, $post_id ){
		$_post = Helper::get_video_post( $post_id );

		if( !$_post || !$_post->video_id ){
			return $content;
		}

		$has_thumbnail = get_post_meta( $post_id, '_thumbnail_id', true );
		if( !$_post->thumbnails ){
			$has_thumbnail = true;
		}

		if( $has_thumbnail ){
			$content .= '<hr /><br />';
			$content .= sprintf(
			        '<a href="#" id="cvm-import-video-thumbnail" data-refresh="1" data-post="%d"><i class="dashicons dashicons-update"></i> %s</a>',
                    $post_id,
                    __( 'Refresh Vimeo image', 'codeflavors-vimeo-video-post-lite' )
            );
			$content .= sprintf(
				'<p class="description" id="cvm-thumb-response">%s</p>',
				__( 'Will import a fresh image from Vimeo. If already existing, it will be duplicated.', 'codeflavors-vimeo-video-post-lite' )
            );
		}else{
			$content .= '<hr /><br />';
			$content .= sprintf(
			        '<a href="#" id="cvm-import-video-thumbnail" data-refresh="0" data-post="%d"><i class="dashicons dashicons-download"></i >%s</a>',
                    $post_id, __( 'Import Vimeo image', 'codeflavors-vimeo-video-post-lite' )
            );
			$content .= sprintf(
				'<p class="description" id="cvm-thumb-response">%s</p>',
				__( 'Will first search the Media Gallery for an already imported image and will import if none found.', 'codeflavors-vimeo-video-post-lite' )
			);
		}
		return $content;
	}

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!