How to use wp_register_widget_control and wp_register_sidebar_widget
-
I am creating a theme where I am allowing users to add twitter widget. But issue is, wordpress is complaining about “register_sidebar_widget” and “register_widget_control” functions and asking me to use wp_register_sidebar_widget and wp_register_widget_control.
I changed my functions to wp_register_sidebar_widget and wp_register_widget_control. But now I do not see the control fields on the widgetHere is the code for wp_register_widget_control call back function
function twitter_control() {
if(isset($_POST[‘twitter_submit’])) {
$options[‘twitter_title’]
update_option(‘theme_options’,$options);
}
echo ‘<form name=”twitter_control_form” id=”twitter_control_form” method=”post”>’.”\n”;
echo ‘<p><label>Twitter</label></p>’;
echo ‘<p><input type=”text” name=”twitter_title” id=”twitter_title” value=”‘.$options[‘twitter_title’].'”/></p>’;
echo ‘<p><label>Twitter Username</label></p>’;
echo ‘<p><input type=”text” name=”twitter_username” id=”twitter_username” value=”‘.$options[‘twitter_username’].'”/></p>’;
echo ‘<p><label>Twitter Count</label></p>’;
echo ‘<p><input type=”text” name=”twitter_count” id=”twitter_count” value=”‘.$options[‘twitter_count’].'” /></p>’;
echo ‘<p><input type=”submit” name=”twitter_submit” id=”twitter_submit” value=”Save Changes” /></p>’.”\n”;
echo ‘</form>’.”\n”;
}Can somebody help, I tried to look for examples over the web, but couldn’t find one. There is hardly any documentation available for wp_register_sidebar_widget and wp_register_widget_control ??
- The topic ‘How to use wp_register_widget_control and wp_register_sidebar_widget’ is closed to new replies.