I am reading this tutorial from the end of 2008 on how to make widget and so far everything works fine except that I have few questions that I couldn’t find answers there.
I need to style back end widget form somewhat different and for that purpose I would like to be able to add class to it that will render only in dashboard.
I am using these 2 functions to build my widget:
wp_register_sidebar_widget(SAASJOTC_WIDGET_ID,
__('Text Ripple'), 'widget_saasjotc');
wp_register_widget_control(SAASJOTC_WIDGET_ID,
__('Text Ripple'), 'widget_saasjotc_control');
Is this method deprecated considering year of the article I am reading? If yes please could you provide me with better way and why?
With this method I can add only one widget to the sidebar and I need to be able to add more. How can this be achieved?
Any help appreciated. Sorry if there are any difficulties in my description. I’ll be happy to clarify it further for you if need arises.
I don’t know if the tutorial uses any deprecated function, you can check that enabling WP_DEBUG in your wp-config.php.
Anyway, by the time it was written the new Widgets API didn’t exist.
The Codex is your friend, read the Codex:
http://codex.wordpress.org/Widgets_API
And for styling the widgets admin area refer to this post:
Highlight custom widgets in the admin area?