Support » Plugin: YouTube widget » bug patch to avoid deprecated function

  • Despite the new version on github here’s a patch to avoid the deprecated register_sidebar_widget and register_widget_control functions.

    So, in case you’re stuck with this plugin, apply these changes:

    Index: youtube-widget/youtube.php
    --- youtube-widget/youtube.php	(revision 3411)
    +++ youtube-widget/youtube.php	(working copy)
    @@ -24,7 +24,7 @@
     	// Check for the required plugin functions. This will prevent fatal
     	// errors occurring when you deactivate the dynamic-sidebar plugin.
    -	if ( !function_exists('register_sidebar_widget') )
    +	if ( !function_exists('wp_register_sidebar_widget') )
     	// This is the function that outputs our little Google search form.
    @@ -156,11 +156,11 @@
     	// This registers our widget so it appears with the other available
     	// widgets and can be dragged and dropped into any active sidebars.
    -	register_sidebar_widget(array('YouTube', 'widgets'), 'widget_youtube');
    +	wp_register_sidebar_widget('widget_youtube', array('YouTube', 'widgets'), 'widget_youtube');
     	// This registers our optional widget control form. Because of this
     	// our widget will have a button that reveals a 300x100 pixel form.
    -	register_widget_control(array('YouTube', 'widgets'), 'widget_youtube_control', 300, 200);
    +	wp_register_widget_control('widget_youtube_control', array('YouTube', 'widgets'), 'widget_youtube_control', 300, 200);
     // Run our code later in case this loads prior to any required plugins.

  • The topic ‘bug patch to avoid deprecated function’ is closed to new replies.