Skip to content

Instantly share code, notes, and snippets.

@jessepearson
Created January 8, 2015 17:52
Show Gist options
  • Save jessepearson/c2e8bc73c2aa71f2f202 to your computer and use it in GitHub Desktop.
Save jessepearson/c2e8bc73c2aa71f2f202 to your computer and use it in GitHub Desktop.
Example from WordPress Codex for the Widget API with CSS classes
<?php
/**
* Register widget with WordPress.
*/
function __construct() {
parent::__construct(
'foo_widget', // Base ID
__( 'Widget Title', 'text_domain' ), // Name
array(
'classname' => 'YOUR WIDGET CLASSES',
'description' => __( 'A Foo Widget', 'text_domain' ), ) // Args
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment