33 'name' =>
'gravityview_form_id',
34 'id' =>
'gravityview_form_id',
38 'show_option_none' => sprintf(
'— %s —', esc_html__(
'list of forms',
'gk-gravityview' ) ),
39 'data' => array(
'search-type' =>
'form' ),
46 if( array() === $args[
'options'] ) {
49 if ( in_array( $form[
'id'], $args[
'exclude'] ) ) {
53 $args[
'options'][ $form[
'id'] ] = esc_html( $form[
'title'] );
73 'name' =>
'gravityview_form_fields',
74 'id' =>
'gravityview_form_fields',
78 'show_option_none' => __(
'Select a field',
'gk-gravityview' ),
79 'data' => array(
'search-type' =>
'form' ),
84 if( empty(
$args[
'form_id'] ) ) {
90 if( array() ===
$args[
'options'] ) {
112 'options' => array(),
117 'placeholder' => null,
120 'show_option_all' => _x(
'All',
'all dropdown items',
'gk-gravityview' ),
121 'show_option_none' => _x(
'None',
'no dropdown items',
'gk-gravityview' ),
129 $data_elements .=
' data-' . esc_attr( $key ) .
'="' . esc_attr(
$value ) .
'"';
132 if(
$args[
'multiple'] ) {
133 $multiple =
' MULTIPLE';
138 if(
$args[
'placeholder'] ) {
144 $disabled =
$args[
'disabled'] ?
' disabled="disabled"' :
'';
145 $class = implode(
' ', array_map(
'sanitize_html_class', explode(
' ',
$args[
'class'] ) ) );
146 $output =
'<select name="' . esc_attr(
$args[
'name'] ) .
'" id="' . esc_attr( str_replace(
'-',
'_',
$args[
'id'] ) ) .
'" class="gravityview-select ' .
$class .
'"' . $multiple . $disabled .
' data-placeholder="' .
$placeholder .
'"'. $data_elements .
'>';
148 if ( ! empty(
$args[
'options'] ) ) {
150 if (
$args[
'show_option_none'] ) {
151 if(
$args[
'multiple'] ) {
152 $selected = selected(
true, in_array( -1,
$args[
'selected'] ),
false );
154 $selected = selected(
$args[
'selected'], -1,
false );
156 $output .=
'<option value="-1"' . $selected .
'>' . esc_html(
$args[
'show_option_none'] ) .
'</option>';
159 foreach(
$args[
'options'] as $key => $option ) {
161 if(
$args[
'multiple'] && is_array(
$args[
'selected'] ) ) {
162 $selected = selected(
true, in_array( $key,
$args[
'selected'],
true ),
false );
164 $selected = selected(
$args[
'selected'], $key,
false );
167 $output .=
'<option value="' . esc_attr( $key ) .
'"' . $selected .
'>' . esc_html( $option ) .
'</option>';
form_dropdown( $args=array())
Renders an HTML Dropdown of all the Products (Downloads)
field_dropdown( $args=array())
Renders an HTML Dropdown of all the fields in a form.
if(gravityview() ->plugin->is_GF_25()) $form
gravityview_get_forms( $active=true, $trash=false, $order_by='date_created', $order='ASC')
Alias of GFAPI::get_forms()
static get_sortable_fields_array( $formid, $blocklist=array( 'list', 'textarea'))
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed
select( $args=array())
Renders an HTML Dropdown.