How can I get $id variable in widget’s form function?

Do you search for $args['widget_id']? Just save it in a variable you can access in form() later.

Look at wp-includes/default-widgets.php to see how widgets work. Not the best code, but it should give you some hints.

Leave a Comment