Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 );
share|improve this question
add comment

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

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

1 Answer

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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