Created
August 25, 2013 10:21
-
-
Save michael-cannon/6333132 to your computer and use it in GitHub Desktop.
Filter `custom_bulkquick_edit_settings_display_setting`. Display the additional field input types offered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'custom_bulkquick_edit_settings_display_setting', 'display_setting', 10, 2 ); | |
public function display_setting( $args, $input ) { | |
$content = ''; | |
extract( $args ); | |
if ( is_null( $input ) ) { | |
$options = get_option( self::ID ); | |
} else { | |
$options = array(); | |
$options[$id] = $input; | |
} | |
if ( ! isset( $options[$id] ) && $type != 'checkbox' ) | |
$options[$id] = $std; | |
elseif ( ! isset( $options[$id] ) ) | |
$options[$id] = 0; | |
$field_class = ''; | |
if ( ! empty( $class ) ) | |
$field_class = ' ' . $class; | |
// desc isn't escaped because it's might contain allowed html | |
$choices = array_map( 'esc_attr', $choices ); | |
$field_class = esc_attr( $field_class ); | |
$id = esc_attr( $id ); | |
$options[$id] = esc_attr( $options[$id] ); | |
$std = esc_attr( $std ); | |
switch ( $type ) { | |
case 'date': | |
$content .= 'date goes here'; | |
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . self::ID . '[' . $id . ']" placeholder="' . $std . '" value="' . $options[$id] . '" />'; | |
if ( ! empty( $desc ) ) | |
$content .= '<br /><span class="description">' . $desc . '</span>'; | |
break; | |
} | |
return $content; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment