views:

175

answers:

2

%wordpress I've created to tool to turn php functions into Wordpress widgets. I use the register_sidebar_widget function but it seems like wp_register_sidebar_widget would give me more options. Does anyone know if that is legal?

P.S. I also generate widgets in the new 2.8 format.

A: 

Legal? Sure. WordPress is GPL, you can do anything you like as long as you follow the requirements of the license.

ceejayoz
I meant legit I guess. Since my tool will be creating many widgets I want to make sure I'm using the "preferred", "supported", "least likely to break in future versions" way of building widgets.
gbennett
+2  A: 

register_sidebar_widget is deprecated--though it can still be used, but you could use wp_register_sidebar_widget. If you do use register_sidebar_widget might want to bracket it in an if ( function_exists('register_sidebar_widget') ) in case that function gets removed in subsequent versions.

Also, there is a plugin, Otto's PHP Code Widget, that allows PHP code in a widget.

  1. http://codex.wordpress.org/WordPress_Widgets_Api/register_sidebar_widget
  2. http://codex.wordpress.org/WordPress_Widgets_Api/wp_register_sidebar_widget
  3. http://wordpress.org/extend/plugins/php-code-widget
Michael