Skip to content

Instantly share code, notes, and snippets.

@raideus
Created February 16, 2013 00:58
Show Gist options
  • Save raideus/4964911 to your computer and use it in GitHub Desktop.
Save raideus/4964911 to your computer and use it in GitHub Desktop.
Add support for field type "password" to WP Settings Framework
<?php
switch( $type ){
case 'text':
$val = esc_attr(stripslashes($val));
echo '<input type="text" name="'. $this->option_group .'_settings['. $el_id .']" id="'. $el_id .'" value="'. $val .'" class="regular-text '. $class .'" />';
if($desc) echo '<p class="description">'. $desc .'</p>';
break;
case 'password':
$val = esc_attr(stripslashes($val));
echo '<input type="password" name="'. $this->option_group .'_settings['. $el_id .']" id="'. $el_id .'" value="'. $val .'" class="regular-text '. $class .'" />';
if($desc) echo '<p class="description">'. $desc .'</p>';
break;
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment