2

Could someone explain to me what "classname" in the $widget_ops array means when you're creating a custom widget? It doesn't seem to have any relevance. I've searched both the source and the db and can't find any instance of it.

$widget_ops = array( 'classname' => 'example', 'description' => 'widget description ' );

$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'example-widget' );

$this->WP_Widget( 'example-widget', 'Example Widget', $widget_ops, $control_ops );

migrated from stackoverflow.com Sep 13 '12 at 22:56

This question came from our site for professional and enthusiast programmers.

2

It is simply the css class of the widget.

Take a look here : http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/widgets.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.