Skip to content

Instantly share code, notes, and snippets.

@webmasterninjay
Last active August 29, 2015 14:16
Show Gist options
  • Save webmasterninjay/b286fa2bc8a7dc7889ee to your computer and use it in GitHub Desktop.
Save webmasterninjay/b286fa2bc8a7dc7889ee to your computer and use it in GitHub Desktop.
Add default value for widget field
<?php
// Form function
$default = array( 'recent_post_count' => '2' );
$instance = wp_parse_args( (array) $instance, $default );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment