WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

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

Your Answer


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.