Skip to content

Commit

Permalink
Add some basic default styling to fields in the Facetious widget. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion committed Mar 22, 2013
1 parent 9be2d1a commit a6bbe7d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
10 changes: 4 additions & 6 deletions class.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct( $file ) {
* @return string URL
* @author John Blackbourn
**/
protected function plugin_url( $file = '' ) {
public function plugin_url( $file = '' ) {
return $this->plugin( 'url', $file );
}

Expand All @@ -33,7 +33,7 @@ protected function plugin_url( $file = '' ) {
* @return string Filesystem path
* @author John Blackbourn
**/
protected function plugin_path( $file = '' ) {
public function plugin_path( $file = '' ) {
return $this->plugin( 'path', $file );
}

Expand All @@ -44,7 +44,7 @@ protected function plugin_path( $file = '' ) {
* @return string Version
* @author John Blackbourn
**/
protected function plugin_ver( $file ) {
public function plugin_ver( $file ) {
return filemtime( $this->plugin_path( $file ) );
}

Expand All @@ -54,7 +54,7 @@ protected function plugin_ver( $file ) {
* @return string Basename
* @author John Blackbourn
**/
protected function plugin_base() {
public function plugin_base() {
return $this->plugin( 'base' );
}

Expand Down Expand Up @@ -90,5 +90,3 @@ public function n( $singular, $plural, $number ) {
}

defined( 'ABSPATH' ) or die();

?>
11 changes: 9 additions & 2 deletions class.widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ function __construct() {
**/
function widget( $args, $instance ) {

$facetious = Facetious::init();

wp_enqueue_style(
'facetious_widget',
$facetious->plugin_url( 'facetious.css' ),
null,
$facetious->plugin_ver( 'facetious.css' )
);

echo $args['before_widget'];

if ( !empty( $instance['title'] ) )
Expand Down Expand Up @@ -198,5 +207,3 @@ function register() {
}

add_action( 'widgets_init', array( 'Facetious_Widget', 'register' ) );

?>
5 changes: 5 additions & 0 deletions facetious.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

.widget_facetious_widget .facetious_input,
.widget_facetious_widget .facetious_filter {
display: block;
}

0 comments on commit a6bbe7d

Please sign in to comment.