Viewing 2 replies - 1 through 2 (of 2 total)
  • jamieskella

    (@jamieskella)

    I get the same error.

    The author is lazy and decided he wanted to use anonymous functions, which weren’t introduced until PHP 5.3, which is not yet available on most web hosts.

    Here’s the fix I’ve whipped up in 5 minutes. Replace everything in youtube_embed.php below the comment block with the following:

    function buttons($buttons) {
    	array_unshift($buttons, 'youtube_embed');
    	return $buttons;
    }
    
    function plugins($plugin_array) {
    	$plugin_array['youtube_embed'] = WP_PLUGIN_URL . '/tinymce-youtube-embed/youtube_embed.js';
    	return $plugin_array;
    }
    
    function youtube_embed() {
    	if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {
    		return;
    	}
    
    	add_filter('mce_buttons', 'buttons');
    
    	add_filter( 'mce_external_plugins', 'plugins');
    }
    
    add_action( 'init', 'youtube_embed');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: TinyMCE YouTube Embed] Can't activate – Fatal error’ is closed to new replies.