WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Black Studio TinyMCE Widget] "Youtube Shortcode" button not visible (6 posts)

  1. matteth
    Member
    Posted 2 years ago #

    I'm trying to use Black Studio TinyMCE Widget in conjunction with the Youtube shortcode plugin to enable rich text, image and Youtube insertion in the same widget.
    The Youtube shortcode plugin adds a button to the TinyMCE toolbar, which inserts a shortcode in the text field. But the button doesn't show in the Black Studio TinyMCE Widget.

    I'm not sure in which of the plugins the problem lies - can anyone find a solution?


    Black Studio TinyMCE Widget

    Youtube shortcode plugin

  2. Tubal
    Member
    Posted 2 years ago #

    Hi, I'm the author of the Youtube shortcode plugin.

    Please, go to the plugins folder, then go to the youtube-shortcode folder and edit the youtube-shortcode.php file. Replace the Youtube_shortcode function (class constructor) with the one I've pasted below. Save the file and test if the button appears now in your widget:

    // Constructor / initialize plugin
    function Youtube_shortcode()
    {
        // Load our shortcode only on the frontend
        if ( !is_admin() )
        {
            // Is it a mobile phone? What browser?
            $this->is_mobile();
            // Guess once host language (used for Youtube's old embed code = Flash only)
            $this->get_hl();
            // do_shortcode() is registered as a default filter on 'the_content' with a priority of 11.
            add_shortcode('youtube_sc', array($this, 'output_html'));
            add_action('wp_head', array($this, 'output_css'));
        }
        else
        {
            add_action('admin_init', array($this, 'setup_tinymce_button'));
        }
    }

    Please report if it worked.

  3. matteth
    Member
    Posted 2 years ago #

    Yes, it works! This makes for a nice solution for letting clients have editable widgets, with video capabilities.

    Will you include the fix in the plugin?

    Thanks Tubal!:)

  4. Tubal
    Member
    Posted 2 years ago #

    Glad it worked.

    I will include the fix in the next version so that any rich editor shows the Youtube button.

  5. Tubal
    Member
    Posted 2 years ago #

    I've added a Flattr this! link to the documentation website.

    Thanks for your suggestion!!

  6. matteth
    Member
    Posted 2 years ago #

    Wonderful! I've now flattred you, for great support :)

Topic Closed

This topic has been closed to new replies.

About this Topic