28 add_filter(
'gravityview/extension/search/input_type', array( $this,
'set_input_type' ), 10, 3 );
30 add_filter(
'gravityview/search/input_types', array( $this,
'add_input_type' ) );
32 add_filter(
'gravityview/search/searchable_fields', array( $this,
'modify_searchable_fields' ), 10, 2 );
34 add_filter(
'gravityview/search/searchable_fields/allowlist', array( $this,
'modify_searchable_fields_allowlist' ), 10, 3 );
36 add_filter(
'gravityview/search/input_labels', array( $this,
'add_input_label' ) );
38 add_action(
'gravityview_search_widget_field_before', array( $this,
'print_scripts' ), 10, 2 );
40 add_action(
'gravityview_search_widget_field_before', array( $this,
'print_styles' ), 10, 2 );
58 if ( ! $with_full_field ) {
59 return $searchable_fields;
62 foreach( $searchable_fields as $searchable_field ) {
64 if ( self::INPUT_TYPE !== \
GV\Utils::get( $searchable_field,
'input' ) ) {
68 $field = GFAPI::get_field( $searchable_field[
'form_id'], $searchable_field[
'field'] );
70 foreach(
$field->get_entry_inputs() as $input ) {
71 $searchable_fields[] = array(
72 'field' => $input[
'id'],
77 return $searchable_fields;
94 static $did_print_styles;
103 $should_print_styles = apply_filters(
'gravityview/search/chained_selects/print_styles',
true, $search_widget,
$search_field );
105 if ( ! $should_print_styles || $did_print_styles ) {
111 .gfield_chainedselect span {
112 display:
inline-block;
116 .gfield_chainedselect.vertical span {
121 .gfield_chainedselect.vertical select {
128 $did_print_styles =
true;
145 if ( ! function_exists(
'gf_chained_selects' ) ) {
146 gravityview()->log->error(
'The Gravity Forms Chained Select Add-On is not active.' );
151 if ( ! class_exists(
'GFFormDisplay' ) ) {
156 if ( empty( GFFormDisplay::$hooks_js_printed ) ) {
157 echo GFCommon::get_hooks_javascript_code();
160 if ( ! wp_script_is(
'gform_chained_selects' ) ) {
161 wp_enqueue_script(
'gform_chained_selects', gf_chained_selects()->get_base_url() .
'/js/frontend.js', array(
164 ), gf_chained_selects()->get_version() );
168 gf_chained_selects()->localize_scripts();
170 wp_print_scripts(
'gform_chained_selects' );
180 $field_values = array();
182 foreach (
$gf_field->get_entry_inputs() as $input ) {
185 $input_url_arg =
'input_' . str_replace(
'.',
'_', $input[
'id'] );
190 return $field_values;
195 $input_labels[ self::INPUT_TYPE ] = esc_html__(
'Chained Select',
'gk-gravityview' );
197 return $input_labels;
212 foreach( $fields as $key =>
$field ) {
213 if(
'chainedselect' ===
$field[
'type'] && ! empty(
$field[
'parent'] ) ) {
214 unset( $fields[ $key ] );
230 $input_type[ self::INPUT_TYPE ] = array( self::INPUT_TYPE,
'input_text' );
244 if ( ! in_array( $field_type, array(
'chainedselect' ) ) ) {
248 return self::INPUT_TYPE;
static _REQUEST( $name, $default=null)
Grab a value from the _REQUEST superglobal or default.
if(empty( $created_by)) $form_id
gravityview()
The main GravityView wrapper function.
Abstract class that makes it easy for plugins and themes to register no-conflict scripts and styles...
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed