How to find your YouTube channel ID

To find your YouTube channel ID, which is unique for every user, and query for your channel videos, follow the steps below:

  1. Sign in to YouTube.
  2. In the top right, click your profile picture and then Settings.
  3. From the left menu, select Advanced settings.
  4. You’ll see your channel’s user and channel IDs.

Copy the channel ID and use it in WPYTHub when selecting the feed type to be “Channel uploads”.

cbc embed allowed

Description

When video embedding is done by the plugin, this filter gives you the choice to prevent videos from being embedded automatically.

Parameters

$allow
(boolean)(required) Allow automatic embedding (true) or deny it (false).

Default:true
$post
(WP_Post)(optional) The current post object

Default:None
$video
(array)(optional) Video details returned by YouTube API.

Default:None

Examples

Deny all embedding.

add_filter( 'cbc_embed_allowed', '__return_false' );

cbc video status timeout

Description

By default, video status checking is done at most once every 24h. To change this 24h interval, use this filter.

Parameters

$interval
(integer)(required) Delay interval in seconds to make YouTube API queries and check video status.

Default:86400

Examples

Change verification interval to 1 hour.

/**
 * Change interval to 1 hour
 * @param integer $seconds - current interval
 * @return integer - new interval in seconds
 */
function change_interval( $seconds ){
	return HOUR_IN_SECONDS;	
}
add_filter( 'cbc_video_status_timeout', 'change_interval' );

cbc check video status

Description

If video status checking is allowed from plugin settings, the plugin will query YouTube API at most once every 24h in order to check if the video being displayed wasn’t deleted from YouTube or its privacy settings modified and made private. In case the video was removed or it is not public anymore, the plugin will automatically set the post status to pending.
This functionality can be bypassed using this filter in which case the video won’t be checked anymore.

Parameters

$allow_check
(boolean)(required) Make the verification (true) or bypass it (false).

Default:true
$post
(WP_Post)(optional) The post object being verified.

Default:None
$video_id
(string)(optional) The current post’s YouTube video ID.

Default:None

Examples

Do not make the verification for post ID 42.

/**
 * Do not allow video status checking for post having ID 42
 * @param boolean $allow
 * @param WP_Post $post
 * @param string $video_id
 * @return boolean
 */
function skip_from_checking( $allow, $post, $video_id ){
	if( 42 == $post->ID ){
		$allow = false;
	}	
	return $allow;
}
add_filter( 'cbc_check_video_status', 'skip_from_checking', 10, 3 );

cbc apply filename suffix

Description

When video image importing into WordPress Media Gallery is enabled from plugin settings, the plugin will automatically import the video image and, by default, apply a suffix “-youtube-thumbnail” to the file name. To prevent the suffix from being applied, simply use this filter.

Parameters

$apply
(boolean)(required) Apply suffix to image file name (true) or prevent it (false).

Default:true

Examples

Prevent file suffix from being applied.

add_filter( 'cbc_apply_filename_suffix', '__return_false' );

cbc compatibility human duration meta

Description

When importing videos for compatible WordPress theme, use this filter to specify the custom field name where the plugin should store the formatted video duration (HH:MM:SS) for all future imported videos. Use this only if your WordPress theme displays video duration.
This filter is part of the Third party compatibility tutorial.

Parameters

$field_name
(string)(required) The custom field name where the plugin should store the formatted video duration.

Default:false

Examples

cbc compatibility duration meta

Description

When importing videos for compatible WordPress theme, use this filter to specify the custom field name where the plugin should store the video duration in seconds for all future imported videos. Use this only if your WordPress theme displays video duration.
This filter is part of the Third party compatibility tutorial.

Parameters

$field_name
(string)(required) The custom field name where the plugin should store the video duration in seconds.

Default:false

Examples

cbc compatibility dislikes meta

Description

When importing videos for compatible WordPress theme, use this filter to specify the custom field name where the plugin should store the number of dislikes for all future imported videos. Use this only if your WordPress theme displays statistics like the number of likes, views, etc.
This filter is part of the Third party compatibility tutorial.

Parameters

$field_name
(string)(required) The custom field name where the plugin should store the number of dislikes.

Default:false

Examples

cbc compatibility views meta

Description

When importing videos for compatible WordPress theme, use this filter to specify the custom field name where the plugin should store the number of views for all future imported videos. Use this only if your WordPress theme displays statistics like the number of likes, views, etc.
This filter is part of the Third party compatibility tutorial.

Parameters

$field_name
(string)(required) The custom field name where the plugin should store the number of views.

Default:false

Examples

cbc compatibility likes meta

Description

When importing videos for compatible WordPress theme, use this filter to specify the custom field name where the plugin should store the number of likes for all future imported videos. Use this only if your WordPress theme displays statistics like the number of likes, views, etc.
This filter is part of the Third party compatibility tutorial.

Parameters

$field_name
(string)(required) The custom field name where the plugin should store the number of likes.

Default:false

Examples