wpythub tinymce enabled

Description

Filter whether the “Embed video” button of Video Hub is added to the classic editor (TinyMCE) of a post type. Turn it off for post types where the button isn’t needed, such as WooCommerce products. Available since Video Hub 2.1.1.

Parameters

$enabled
(bool)(required) Whether the classic editor button is added. Default true.
$post_type
(string)(required) The post type of the current edit screen.

Examples

Remove the button from WooCommerce products.

add_filter( 'wpythub_tinymce_enabled', function( $enabled, $post_type ) {
    return 'product' === $post_type ? false : $enabled;
}, 10, 2 );

Start importing in minutes

Bring your YouTube content into WordPress and let it update itself. Includes automatic updates and support.