Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Filter `custom_bulkquick_edit_settings_display_setting`. Display the additional field input types offered.
<?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