@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $acf_keys = get_field_objects( $post->ID, array( 'load_value' => false ) ); |
| 57 | 57 | |
| 58 | - if( $acf_keys ) { |
|
| 58 | + if ( $acf_keys ) { |
|
| 59 | 59 | return array_merge( array_keys( $acf_keys ), $meta_keys ); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | * @return void |
| 71 | 71 | */ |
| 72 | 72 | private function fix_posted_fields() { |
| 73 | - if( is_admin() && isset( $_POST['action'] ) && isset( $_POST['post_type'] ) ) { |
|
| 74 | - if( 'editpost' === $_POST['action'] && 'gravityview' === $_POST['post_type'] ) { |
|
| 75 | - $_POST['fields'] = _gravityview_process_posted_fields(); |
|
| 73 | + if ( is_admin() && isset( $_POST[ 'action' ] ) && isset( $_POST[ 'post_type' ] ) ) { |
|
| 74 | + if ( 'editpost' === $_POST[ 'action' ] && 'gravityview' === $_POST[ 'post_type' ] ) { |
|
| 75 | + $_POST[ 'fields' ] = _gravityview_process_posted_fields(); |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -24,9 +24,8 @@ |
||
| 24 | 24 | /** |
| 25 | 25 | * Get a \GV\Field by Field ID for this data source. |
| 26 | 26 | * |
| 27 | - * @param int $field_id The internal field ID (custom content, etc.) |
|
| 28 | 27 | * |
| 29 | - * @return \GV\Field|null The requested field or null if not found. |
|
| 28 | + * @return null|Internal_Field The requested field or null if not found. |
|
| 30 | 29 | */ |
| 31 | 30 | public static function get_field( /** varargs */ ) { |
| 32 | 31 | $args = func_get_args(); |
@@ -44,16 +44,16 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | $atts = apply_filters( 'gravityview/shortcodes/gventry/atts', $atts ); |
| 46 | 46 | |
| 47 | - $view = \GV\View::by_id( $atts['view_id'] ); |
|
| 47 | + $view = \GV\View::by_id( $atts[ 'view_id' ] ); |
|
| 48 | 48 | |
| 49 | 49 | if ( ! $view ) { |
| 50 | - gravityview()->log->error( 'View does not exist #{view_id}', array( 'view_id' => $atts['view_id'] ) ); |
|
| 50 | + gravityview()->log->error( 'View does not exist #{view_id}', array( 'view_id' => $atts[ 'view_id' ] ) ); |
|
| 51 | 51 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', null, null, $atts ); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $entry_id = ! empty( $atts['entry_id'] ) ? $atts['entry_id'] : $atts['id']; |
|
| 54 | + $entry_id = ! empty( $atts[ 'entry_id' ] ) ? $atts[ 'entry_id' ] : $atts[ 'id' ]; |
|
| 55 | 55 | |
| 56 | - switch( $entry_id ): |
|
| 56 | + switch ( $entry_id ): |
|
| 57 | 57 | case 'last': |
| 58 | 58 | if ( class_exists( '\GF_Query' ) ) { |
| 59 | 59 | /** |
@@ -62,17 +62,17 @@ discard block |
||
| 62 | 62 | * Since we're using \GF_Query shorthand initialization we have to reverse the order parameters here. |
| 63 | 63 | */ |
| 64 | 64 | add_filter( 'gravityview_get_entries', $filter = function( $parameters, $args, $form_id ) { |
| 65 | - if ( ! empty( $parameters['sorting'] ) ) { |
|
| 65 | + if ( ! empty( $parameters[ 'sorting' ] ) ) { |
|
| 66 | 66 | /** |
| 67 | 67 | * Reverse existing sorts. |
| 68 | 68 | */ |
| 69 | - $sort = &$parameters['sorting']; |
|
| 70 | - $sort['direction'] = $sort['direction'] == 'RAND' ? : ( $sort['direction'] == 'ASC' ? 'DESC' : 'ASC' ); |
|
| 69 | + $sort = &$parameters[ 'sorting' ]; |
|
| 70 | + $sort[ 'direction' ] = $sort[ 'direction' ] == 'RAND' ?: ( $sort[ 'direction' ] == 'ASC' ? 'DESC' : 'ASC' ); |
|
| 71 | 71 | } else { |
| 72 | 72 | /** |
| 73 | 73 | * Otherwise, sort by date_created. |
| 74 | 74 | */ |
| 75 | - $parameters['sorting'] = array( |
|
| 75 | + $parameters[ 'sorting' ] = array( |
|
| 76 | 76 | 'key' => 'id', |
| 77 | 77 | 'direction' => 'ASC', |
| 78 | 78 | 'is_numeric' => true |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | /** If a sort already exists, reverse it. */ |
| 89 | 89 | if ( $sort = end( $entries->sorts ) ) { |
| 90 | - $entries = $entries->sort( new \GV\Entry_Sort( $sort->field, $sort->direction == \GV\Entry_Sort::RAND ? : ( $sort->direction == \GV\Entry_Sort::ASC ? \GV\Entry_Sort::DESC : \GV\Entry_Sort::ASC ) ), $sort->mode ); |
|
| 90 | + $entries = $entries->sort( new \GV\Entry_Sort( $sort->field, $sort->direction == \GV\Entry_Sort::RAND ?: ( $sort->direction == \GV\Entry_Sort::ASC ? \GV\Entry_Sort::DESC : \GV\Entry_Sort::ASC ) ), $sort->mode ); |
|
| 91 | 91 | } else { |
| 92 | 92 | /** Otherwise, sort by date_created */ |
| 93 | 93 | $entries = $entries->sort( new \GV\Entry_Sort( \GV\Internal_Field::by_id( 'id' ), \GV\Entry_Sort::ASC ), \GV\Entry_Sort::NUMERIC ); |
@@ -105,12 +105,12 @@ discard block |
||
| 105 | 105 | break; |
| 106 | 106 | default: |
| 107 | 107 | if ( ! $entry = \GV\GF_Entry::by_id( $entry_id ) ) { |
| 108 | - gravityview()->log->error( 'Entry #{entry_id} not found', array( 'view_id' => $atts['view_id'] ) ); |
|
| 108 | + gravityview()->log->error( 'Entry #{entry_id} not found', array( 'view_id' => $atts[ 'view_id' ] ) ); |
|
| 109 | 109 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, null, $atts ); |
| 110 | 110 | } |
| 111 | 111 | endswitch; |
| 112 | 112 | |
| 113 | - if ( $view->form->ID != $entry['form_id'] ) { |
|
| 113 | + if ( $view->form->ID != $entry[ 'form_id' ] ) { |
|
| 114 | 114 | gravityview()->log->error( 'Entry does not belong to view (form mismatch)' ); |
| 115 | 115 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, $entry, $atts ); |
| 116 | 116 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | return apply_filters( 'gravityview/shortcodes/gventry/output', get_the_password_form( $view->ID ), $view, $entry, $atts ); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if ( ! $view->form ) { |
|
| 123 | + if ( ! $view->form ) { |
|
| 124 | 124 | gravityview()->log->notice( 'View #{id} has no form attached to it.', array( 'id' => $view->ID ) ); |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -143,15 +143,15 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** Unapproved entries. */ |
| 146 | - if ( $entry['status'] != 'active' ) { |
|
| 146 | + if ( $entry[ 'status' ] != 'active' ) { |
|
| 147 | 147 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
| 148 | 148 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, $entry, $atts ); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID ); |
|
| 151 | + $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID ); |
|
| 152 | 152 | |
| 153 | 153 | if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
| 154 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 154 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 155 | 155 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
| 156 | 156 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, $entry, $atts ); |
| 157 | 157 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $renderer = new \GV\Entry_Renderer(); |
| 164 | 164 | |
| 165 | 165 | $request = new \GV\Mock_Request(); |
| 166 | - $request->returns['is_entry'] = $entry; |
|
| 166 | + $request->returns[ 'is_entry' ] = $entry; |
|
| 167 | 167 | |
| 168 | 168 | $output = $renderer->render( $entry, $view, $request ); |
| 169 | 169 | |
@@ -29,12 +29,12 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public static function from_configuration( $configuration ) { |
| 31 | 31 | |
| 32 | - if ( empty( $configuration['id'] ) || ! is_string( $configuration['id'] ) ) { |
|
| 32 | + if ( empty( $configuration[ 'id' ] ) || ! is_string( $configuration[ 'id' ] ) ) { |
|
| 33 | 33 | gravityview()->log->error( 'Invalid configuration[id] supplied.' ); |
| 34 | 34 | return null; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - $field = self::by_id( $configuration['id'] ); |
|
| 37 | + $field = self::by_id( $configuration[ 'id' ] ); |
|
| 38 | 38 | |
| 39 | 39 | $field->update_configuration( $configuration ); |
| 40 | 40 | |
@@ -53,7 +53,6 @@ discard block |
||
| 53 | 53 | * Columns are able to be added to View layouts, but not separately searched! |
| 54 | 54 | * |
| 55 | 55 | * @param array $fields |
| 56 | - * @param int $form_id |
|
| 57 | 56 | * |
| 58 | 57 | * @return array |
| 59 | 58 | */ |
@@ -133,7 +132,7 @@ discard block |
||
| 133 | 132 | * |
| 134 | 133 | * @param GF_Field_List $field Gravity Forms field |
| 135 | 134 | * @param string|array $field_value Serialized or unserialized array value for the field |
| 136 | - * @param int|string $column_id The numeric key of the column (0-index) or the label of the column |
|
| 135 | + * @param integer $column_id The numeric key of the column (0-index) or the label of the column |
|
| 137 | 136 | * @param string $format If set to 'raw', return an array of values for the column. Otherwise, allow Gravity Forms to render using `html` or `text` |
| 138 | 137 | * |
| 139 | 138 | * @return array|string|null Returns null if the $field_value passed wasn't an array or serialized array |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | public function remove_columns_from_searchable_fields( $fields ) { |
| 61 | 61 | |
| 62 | 62 | foreach ( $fields as $key => $field ) { |
| 63 | - if ( isset( $field['parent'] ) && $field['parent'] instanceof \GF_Field_List ) { |
|
| 63 | + if ( isset( $field[ 'parent' ] ) && $field[ 'parent' ] instanceof \GF_Field_List ) { |
|
| 64 | 64 | unset( $fields[ $key ] ); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | // Add the list columns |
| 87 | 87 | foreach ( $list_fields as $list_field ) { |
| 88 | 88 | |
| 89 | - if( empty( $list_field->enableColumns ) ) { |
|
| 89 | + if ( empty( $list_field->enableColumns ) ) { |
|
| 90 | 90 | continue; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // If there are columns, add them under the parent field |
| 110 | - if( ! empty( $list_columns ) ) { |
|
| 110 | + if ( ! empty( $list_columns ) ) { |
|
| 111 | 111 | |
| 112 | 112 | $index = array_search( $list_field->id, array_keys( $fields ) ) + 1; |
| 113 | 113 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * Merge the $list_columns into the $fields array at $index |
| 116 | 116 | * @see https://stackoverflow.com/a/1783125 |
| 117 | 117 | */ |
| 118 | - $fields = array_slice( $fields, 0, $index, true) + $list_columns + array_slice( $fields, $index, null, true); |
|
| 118 | + $fields = array_slice( $fields, 0, $index, true ) + $list_columns + array_slice( $fields, $index, null, true ); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | unset( $list_columns, $index, $input_id ); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $list_rows = maybe_unserialize( $field_value ); |
| 144 | 144 | |
| 145 | - if( ! is_array( $list_rows ) ) { |
|
| 145 | + if ( ! is_array( $list_rows ) ) { |
|
| 146 | 146 | gravityview()->log->error( '$field_value did not unserialize', array( 'data' => $field_value ) ); |
| 147 | 147 | return null; |
| 148 | 148 | } |
@@ -152,18 +152,18 @@ discard block |
||
| 152 | 152 | // Each list row |
| 153 | 153 | foreach ( $list_rows as $list_row ) { |
| 154 | 154 | $current_column = 0; |
| 155 | - foreach ( (array) $list_row as $column_key => $column_value ) { |
|
| 155 | + foreach ( (array)$list_row as $column_key => $column_value ) { |
|
| 156 | 156 | |
| 157 | 157 | // If the label of the column matches $column_id, or the numeric key value matches, add the value |
| 158 | - if( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) { |
|
| 159 | - $column_values[] = $column_value; |
|
| 158 | + if ( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) { |
|
| 159 | + $column_values[ ] = $column_value; |
|
| 160 | 160 | } |
| 161 | 161 | $current_column++; |
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | // Return the array of values |
| 166 | - if( 'raw' === $format ) { |
|
| 166 | + if ( 'raw' === $format ) { |
|
| 167 | 167 | return $column_values; |
| 168 | 168 | } |
| 169 | 169 | // Return the Gravity Forms Field output |
@@ -186,22 +186,22 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | public function _filter_field_label( $label, $field, $form, $entry ) { |
| 188 | 188 | |
| 189 | - $field_object = RGFormsModel::get_field( $form, $field['id'] ); |
|
| 189 | + $field_object = RGFormsModel::get_field( $form, $field[ 'id' ] ); |
|
| 190 | 190 | |
| 191 | 191 | // Not a list field |
| 192 | - if( ! $field_object || 'list' !== $field_object->type ) { |
|
| 192 | + if ( ! $field_object || 'list' !== $field_object->type ) { |
|
| 193 | 193 | return $label; |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | // Custom label is defined, so use it |
| 197 | - if( ! empty( $field['custom_label'] ) ) { |
|
| 197 | + if ( ! empty( $field[ 'custom_label' ] ) ) { |
|
| 198 | 198 | return $label; |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - $column_id = gravityview_get_input_id_from_id( $field['id'] ); |
|
| 201 | + $column_id = gravityview_get_input_id_from_id( $field[ 'id' ] ); |
|
| 202 | 202 | |
| 203 | 203 | // Parent field, not column field |
| 204 | - if( false === $column_id ) { |
|
| 204 | + if ( false === $column_id ) { |
|
| 205 | 205 | return $label; |
| 206 | 206 | } |
| 207 | 207 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | public static function get_column_label( GF_Field_List $field, $column_id, $backup_label = '' ) { |
| 223 | 223 | |
| 224 | 224 | // Doesn't have columns enabled |
| 225 | - if( ! isset( $field->choices ) || ! $field->enableColumns ) { |
|
| 225 | + if ( ! isset( $field->choices ) || ! $field->enableColumns ) { |
|
| 226 | 226 | return $backup_label; |
| 227 | 227 | } |
| 228 | 228 | |
@@ -603,7 +603,8 @@ discard block |
||
| 603 | 603 | // Fast-forward 24 hour on the end time |
| 604 | 604 | $curr_end = date( 'Y-m-d H:i:s', strtotime( $curr_end ) + DAY_IN_SECONDS ); |
| 605 | 605 | $search_criteria['end_date'] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end; |
| 606 | - if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056 |
|
| 606 | + if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { |
|
| 607 | +// See https://github.com/gravityview/GravityView/issues/1056 |
|
| 607 | 608 | $search_criteria['end_date'] = date( 'Y-m-d H:i:s', strtotime( $search_criteria['end_date'] ) - 1 ); |
| 608 | 609 | } |
| 609 | 610 | } |
@@ -874,7 +875,7 @@ discard block |
||
| 874 | 875 | 'ymd_dot' => 'Y.m.d', |
| 875 | 876 | ); |
| 876 | 877 | |
| 877 | - if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){ |
|
| 878 | + if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) { |
|
| 878 | 879 | $format = $datepicker[ $field->dateFormat ]; |
| 879 | 880 | } |
| 880 | 881 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | /** |
| 250 | 250 | * Add admin script to the no-conflict scripts whitelist |
| 251 | 251 | * @param array $allowed Scripts allowed in no-conflict mode |
| 252 | - * @return array Scripts allowed in no-conflict mode, plus the search widget script |
|
| 252 | + * @return string[] Scripts allowed in no-conflict mode, plus the search widget script |
|
| 253 | 253 | */ |
| 254 | 254 | public function register_no_conflict( $allowed ) { |
| 255 | 255 | $allowed[] = 'gravityview_searchwidget_admin'; |
@@ -732,7 +732,6 @@ discard block |
||
| 732 | 732 | * Dropin for the legacy flat filters when \GF_Query is available. |
| 733 | 733 | * |
| 734 | 734 | * @param \GF_Query $query The current query object reference |
| 735 | - * @param \GV\View $this The current view object |
|
| 736 | 735 | * @param \GV\Request $request The request object |
| 737 | 736 | */ |
| 738 | 737 | public function gf_query_filter( &$query, $view, $request ) { |
@@ -1414,7 +1413,7 @@ discard block |
||
| 1414 | 1413 | /** |
| 1415 | 1414 | * Get the label for a search form field |
| 1416 | 1415 | * @param array $field Field setting as sent by the GV configuration - has `field`, `input` (input type), and `label` keys |
| 1417 | - * @param array $form_field Form field data, as fetched by `gravityview_get_field()` |
|
| 1416 | + * @param GF_Field|null $form_field Form field data, as fetched by `gravityview_get_field()` |
|
| 1418 | 1417 | * @return string Label for the search form |
| 1419 | 1418 | */ |
| 1420 | 1419 | private static function get_field_label( $field, $form_field = array() ) { |
@@ -1470,7 +1469,7 @@ discard block |
||
| 1470 | 1469 | * Prepare search fields to frontend render with other details (label, field type, searched values) |
| 1471 | 1470 | * |
| 1472 | 1471 | * @param array $field |
| 1473 | - * @return array |
|
| 1472 | + * @return GV\View |
|
| 1474 | 1473 | */ |
| 1475 | 1474 | private function get_search_filter_details( $field ) { |
| 1476 | 1475 | |
@@ -1609,7 +1608,7 @@ discard block |
||
| 1609 | 1608 | /** |
| 1610 | 1609 | * Require the datepicker script for the frontend GV script |
| 1611 | 1610 | * @param array $js_dependencies Array of existing required scripts for the fe-views.js script |
| 1612 | - * @return array Array required scripts, with `jquery-ui-datepicker` added |
|
| 1611 | + * @return string[] Array required scripts, with `jquery-ui-datepicker` added |
|
| 1613 | 1612 | */ |
| 1614 | 1613 | public function add_datepicker_js_dependency( $js_dependencies ) { |
| 1615 | 1614 | |
@@ -1621,7 +1620,7 @@ discard block |
||
| 1621 | 1620 | /** |
| 1622 | 1621 | * Modify the array passed to wp_localize_script() |
| 1623 | 1622 | * |
| 1624 | - * @param array $js_localization The data padded to the Javascript file |
|
| 1623 | + * @param array $localizations The data padded to the Javascript file |
|
| 1625 | 1624 | * @param array $view_data View data array with View settings |
| 1626 | 1625 | * |
| 1627 | 1626 | * @return array |
@@ -1801,7 +1800,7 @@ discard block |
||
| 1801 | 1800 | * |
| 1802 | 1801 | * @param array $get Where to look for the operator. |
| 1803 | 1802 | * @param string $key The filter key to look for. |
| 1804 | - * @param array $allowed The allowed operators (whitelist). |
|
| 1803 | + * @param string[] $allowed The allowed operators (whitelist). |
|
| 1805 | 1804 | * @param string $default The default operator. |
| 1806 | 1805 | * |
| 1807 | 1806 | * @return string The operator. |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | 'type' => 'radio', |
| 65 | 65 | 'full_width' => true, |
| 66 | 66 | 'label' => esc_html__( 'Search Mode', 'gravityview' ), |
| 67 | - 'desc' => __('Should search results match all search fields, or any?', 'gravityview'), |
|
| 67 | + 'desc' => __( 'Should search results match all search fields, or any?', 'gravityview' ), |
|
| 68 | 68 | 'value' => 'any', |
| 69 | 69 | 'class' => 'hide-if-js', |
| 70 | 70 | 'options' => array( |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | // admin - add scripts - run at 1100 to make sure GravityView_Admin_Views::add_scripts_and_styles() runs first at 999 |
| 88 | 88 | add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 1100 ); |
| 89 | - add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts') ); |
|
| 89 | + add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) ); |
|
| 90 | 90 | add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict' ) ); |
| 91 | 91 | |
| 92 | 92 | // ajax - get the searchable fields |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $script_min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
| 231 | 231 | $script_source = empty( $script_min ) ? '/source' : ''; |
| 232 | 232 | |
| 233 | - wp_enqueue_script( 'gravityview_searchwidget_admin', plugins_url( 'assets/js'.$script_source.'/admin-search-widget'.$script_min.'.js', __FILE__ ), array( 'jquery', 'gravityview_views_scripts' ), \GV\Plugin::$version ); |
|
| 233 | + wp_enqueue_script( 'gravityview_searchwidget_admin', plugins_url( 'assets/js' . $script_source . '/admin-search-widget' . $script_min . '.js', __FILE__ ), array( 'jquery', 'gravityview_views_scripts' ), \GV\Plugin::$version ); |
|
| 234 | 234 | |
| 235 | 235 | wp_localize_script( 'gravityview_searchwidget_admin', 'gvSearchVar', array( |
| 236 | 236 | 'nonce' => wp_create_nonce( 'gravityview_ajaxsearchwidget' ), |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | * @return array Scripts allowed in no-conflict mode, plus the search widget script |
| 253 | 253 | */ |
| 254 | 254 | public function register_no_conflict( $allowed ) { |
| 255 | - $allowed[] = 'gravityview_searchwidget_admin'; |
|
| 255 | + $allowed[ ] = 'gravityview_searchwidget_admin'; |
|
| 256 | 256 | return $allowed; |
| 257 | 257 | } |
| 258 | 258 | |
@@ -265,24 +265,24 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | public static function get_searchable_fields() { |
| 267 | 267 | |
| 268 | - if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxsearchwidget' ) ) { |
|
| 268 | + if ( ! isset( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'gravityview_ajaxsearchwidget' ) ) { |
|
| 269 | 269 | exit( '0' ); |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | $form = ''; |
| 273 | 273 | |
| 274 | 274 | // Fetch the form for the current View |
| 275 | - if ( ! empty( $_POST['view_id'] ) ) { |
|
| 275 | + if ( ! empty( $_POST[ 'view_id' ] ) ) { |
|
| 276 | 276 | |
| 277 | - $form = gravityview_get_form_id( $_POST['view_id'] ); |
|
| 277 | + $form = gravityview_get_form_id( $_POST[ 'view_id' ] ); |
|
| 278 | 278 | |
| 279 | - } elseif ( ! empty( $_POST['formid'] ) ) { |
|
| 279 | + } elseif ( ! empty( $_POST[ 'formid' ] ) ) { |
|
| 280 | 280 | |
| 281 | - $form = (int) $_POST['formid']; |
|
| 281 | + $form = (int)$_POST[ 'formid' ]; |
|
| 282 | 282 | |
| 283 | - } elseif ( ! empty( $_POST['template_id'] ) && class_exists( 'GravityView_Ajax' ) ) { |
|
| 283 | + } elseif ( ! empty( $_POST[ 'template_id' ] ) && class_exists( 'GravityView_Ajax' ) ) { |
|
| 284 | 284 | |
| 285 | - $form = GravityView_Ajax::pre_get_form_fields( $_POST['template_id'] ); |
|
| 285 | + $form = GravityView_Ajax::pre_get_form_fields( $_POST[ 'template_id' ] ); |
|
| 286 | 286 | |
| 287 | 287 | } |
| 288 | 288 | |
@@ -332,14 +332,14 @@ discard block |
||
| 332 | 332 | ); |
| 333 | 333 | |
| 334 | 334 | if ( gravityview()->plugin->supports( \GV\Plugin::FEATURE_GFQUERY ) ) { |
| 335 | - $custom_fields['is_approved'] = array( |
|
| 335 | + $custom_fields[ 'is_approved' ] = array( |
|
| 336 | 336 | 'text' => esc_html__( 'Approval Status', 'gravityview' ), |
| 337 | 337 | 'type' => 'multi', |
| 338 | 338 | ); |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - foreach( $custom_fields as $custom_field_key => $custom_field ) { |
|
| 342 | - $output .= sprintf( '<option value="%s" %s data-inputtypes="%s" data-placeholder="%s">%s</option>', $custom_field_key, selected( $custom_field_key, $current, false ), $custom_field['type'], self::get_field_label( array('field' => $custom_field_key ) ), $custom_field['text'] ); |
|
| 341 | + foreach ( $custom_fields as $custom_field_key => $custom_field ) { |
|
| 342 | + $output .= sprintf( '<option value="%s" %s data-inputtypes="%s" data-placeholder="%s">%s</option>', $custom_field_key, selected( $custom_field_key, $current, false ), $custom_field[ 'type' ], self::get_field_label( array( 'field' => $custom_field_key ) ), $custom_field[ 'text' ] ); |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | // Get fields with sub-inputs and no parent |
@@ -361,13 +361,13 @@ discard block |
||
| 361 | 361 | |
| 362 | 362 | foreach ( $fields as $id => $field ) { |
| 363 | 363 | |
| 364 | - if ( in_array( $field['type'], $blacklist_field_types ) ) { |
|
| 364 | + if ( in_array( $field[ 'type' ], $blacklist_field_types ) ) { |
|
| 365 | 365 | continue; |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - $types = self::get_search_input_types( $id, $field['type'] ); |
|
| 368 | + $types = self::get_search_input_types( $id, $field[ 'type' ] ); |
|
| 369 | 369 | |
| 370 | - $output .= '<option value="'. $id .'" '. selected( $id, $current, false ).'data-inputtypes="'. esc_attr( $types ) .'">'. esc_html( $field['label'] ) .'</option>'; |
|
| 370 | + $output .= '<option value="' . $id . '" ' . selected( $id, $current, false ) . 'data-inputtypes="' . esc_attr( $types ) . '">' . esc_html( $field[ 'label' ] ) . '</option>'; |
|
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | public static function get_search_input_types( $field_id = '', $field_type = null ) { |
| 391 | 391 | |
| 392 | 392 | // @todo - This needs to be improved - many fields have . including products and addresses |
| 393 | - if ( false !== strpos( (string) $field_id, '.' ) && in_array( $field_type, array( 'checkbox' ) ) || in_array( $field_id, array( 'is_fulfilled' ) ) ) { |
|
| 393 | + if ( false !== strpos( (string)$field_id, '.' ) && in_array( $field_type, array( 'checkbox' ) ) || in_array( $field_id, array( 'is_fulfilled' ) ) ) { |
|
| 394 | 394 | $input_type = 'boolean'; // on/off checkbox |
| 395 | 395 | } elseif ( in_array( $field_type, array( 'checkbox', 'post_category', 'multiselect' ) ) ) { |
| 396 | 396 | $input_type = 'multi'; //multiselect |
@@ -436,19 +436,19 @@ discard block |
||
| 436 | 436 | $post_id = 0; |
| 437 | 437 | |
| 438 | 438 | // We're in the WordPress Widget context, and an overriding post ID has been set. |
| 439 | - if ( ! empty( $widget_args['post_id'] ) ) { |
|
| 440 | - $post_id = absint( $widget_args['post_id'] ); |
|
| 439 | + if ( ! empty( $widget_args[ 'post_id' ] ) ) { |
|
| 440 | + $post_id = absint( $widget_args[ 'post_id' ] ); |
|
| 441 | 441 | } |
| 442 | 442 | // We're in the WordPress Widget context, and the base View ID should be used |
| 443 | - else if ( ! empty( $widget_args['view_id'] ) ) { |
|
| 444 | - $post_id = absint( $widget_args['view_id'] ); |
|
| 443 | + else if ( ! empty( $widget_args[ 'view_id' ] ) ) { |
|
| 444 | + $post_id = absint( $widget_args[ 'view_id' ] ); |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | $args = gravityview_get_permalink_query_args( $post_id ); |
| 448 | 448 | |
| 449 | 449 | // Add hidden fields to the search form |
| 450 | 450 | foreach ( $args as $key => $value ) { |
| 451 | - $search_fields[] = array( |
|
| 451 | + $search_fields[ ] = array( |
|
| 452 | 452 | 'name' => $key, |
| 453 | 453 | 'input' => 'hidden', |
| 454 | 454 | 'value' => $value, |
@@ -487,28 +487,28 @@ discard block |
||
| 487 | 487 | /** |
| 488 | 488 | * Include the sidebar Widgets. |
| 489 | 489 | */ |
| 490 | - $widgets = (array) get_option( 'widget_gravityview_search', array() ); |
|
| 490 | + $widgets = (array)get_option( 'widget_gravityview_search', array() ); |
|
| 491 | 491 | |
| 492 | 492 | foreach ( $widgets as $widget ) { |
| 493 | - if ( ! empty( $widget['view_id'] ) && $widget['view_id'] == $view->ID ) { |
|
| 494 | - if( $_fields = json_decode( $widget['search_fields'], true ) ) { |
|
| 493 | + if ( ! empty( $widget[ 'view_id' ] ) && $widget[ 'view_id' ] == $view->ID ) { |
|
| 494 | + if ( $_fields = json_decode( $widget[ 'search_fields' ], true ) ) { |
|
| 495 | 495 | foreach ( $_fields as $field ) { |
| 496 | - if ( empty( $field['form_id'] ) ) { |
|
| 497 | - $field['form_id'] = $view->form ? $view->form->ID : 0; |
|
| 496 | + if ( empty( $field[ 'form_id' ] ) ) { |
|
| 497 | + $field[ 'form_id' ] = $view->form ? $view->form->ID : 0; |
|
| 498 | 498 | } |
| 499 | - $searchable_fields[] = $with_full_field ? $field : $field['field']; |
|
| 499 | + $searchable_fields[ ] = $with_full_field ? $field : $field[ 'field' ]; |
|
| 500 | 500 | } |
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | foreach ( $view->widgets->by_id( $this->get_widget_id() )->all() as $widget ) { |
| 506 | - if( $_fields = json_decode( $widget->configuration->get( 'search_fields' ), true ) ) { |
|
| 506 | + if ( $_fields = json_decode( $widget->configuration->get( 'search_fields' ), true ) ) { |
|
| 507 | 507 | foreach ( $_fields as $field ) { |
| 508 | - if ( empty( $field['form_id'] ) ) { |
|
| 509 | - $field['form_id'] = $view->form ? $view->form->ID : 0; |
|
| 508 | + if ( empty( $field[ 'form_id' ] ) ) { |
|
| 509 | + $field[ 'form_id' ] = $view->form ? $view->form->ID : 0; |
|
| 510 | 510 | } |
| 511 | - $searchable_fields[] = $with_full_field ? $field : $field['field']; |
|
| 511 | + $searchable_fields[ ] = $with_full_field ? $field : $field[ 'field' ]; |
|
| 512 | 512 | } |
| 513 | 513 | } |
| 514 | 514 | } |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | return $search_criteria; // Return the original criteria, GF_Query modification kicks in later |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | - if( 'post' === $this->search_method ) { |
|
| 541 | + if ( 'post' === $this->search_method ) { |
|
| 542 | 542 | $get = $_POST; |
| 543 | 543 | } else { |
| 544 | 544 | $get = $_GET; |
@@ -557,15 +557,15 @@ discard block |
||
| 557 | 557 | $get = gv_map_deep( $get, 'rawurldecode' ); |
| 558 | 558 | |
| 559 | 559 | // Make sure array key is set up |
| 560 | - $search_criteria['field_filters'] = \GV\Utils::get( $search_criteria, 'field_filters', array() ); |
|
| 560 | + $search_criteria[ 'field_filters' ] = \GV\Utils::get( $search_criteria, 'field_filters', array() ); |
|
| 561 | 561 | |
| 562 | 562 | $searchable_fields = $this->get_view_searchable_fields( $view ); |
| 563 | 563 | $searchable_field_objects = $this->get_view_searchable_fields( $view, true ); |
| 564 | 564 | |
| 565 | 565 | // add free search |
| 566 | - if ( isset( $get['gv_search'] ) && '' !== $get['gv_search'] && in_array( 'search_all', $searchable_fields ) ) { |
|
| 566 | + if ( isset( $get[ 'gv_search' ] ) && '' !== $get[ 'gv_search' ] && in_array( 'search_all', $searchable_fields ) ) { |
|
| 567 | 567 | |
| 568 | - $search_all_value = trim( $get['gv_search'] ); |
|
| 568 | + $search_all_value = trim( $get[ 'gv_search' ] ); |
|
| 569 | 569 | |
| 570 | 570 | /** |
| 571 | 571 | * @filter `gravityview/search-all-split-words` Search for each word separately or the whole phrase? |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | foreach ( $words as $word ) { |
| 593 | - $search_criteria['field_filters'][] = array( |
|
| 593 | + $search_criteria[ 'field_filters' ][ ] = array( |
|
| 594 | 594 | 'key' => null, // The field ID to search |
| 595 | 595 | 'value' => $word, // The value to search |
| 596 | 596 | 'operator' => 'contains', // What to search in. Options: `is` or `contains` |
@@ -603,14 +603,14 @@ discard block |
||
| 603 | 603 | /** |
| 604 | 604 | * Get and normalize the dates according to the input format. |
| 605 | 605 | */ |
| 606 | - if ( $curr_start = ! empty( $get['gv_start'] ) ? $get['gv_start'] : '' ) { |
|
| 607 | - if( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) { |
|
| 606 | + if ( $curr_start = ! empty( $get[ 'gv_start' ] ) ? $get[ 'gv_start' ] : '' ) { |
|
| 607 | + if ( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) { |
|
| 608 | 608 | $curr_start = $curr_start_date->format( 'Y-m-d' ); |
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | - if ( $curr_end = ! empty( $get['gv_start'] ) ? ( ! empty( $get['gv_end'] ) ? $get['gv_end'] : '' ) : '' ) { |
|
| 613 | - if( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) { |
|
| 612 | + if ( $curr_end = ! empty( $get[ 'gv_start' ] ) ? ( ! empty( $get[ 'gv_end' ] ) ? $get[ 'gv_end' ] : '' ) : '' ) { |
|
| 613 | + if ( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) { |
|
| 614 | 614 | $curr_end = $curr_end_date->format( 'Y-m-d' ); |
| 615 | 615 | } |
| 616 | 616 | } |
@@ -645,22 +645,22 @@ discard block |
||
| 645 | 645 | */ |
| 646 | 646 | if ( ! empty( $curr_start ) ) { |
| 647 | 647 | $curr_start = date( 'Y-m-d H:i:s', strtotime( $curr_start ) ); |
| 648 | - $search_criteria['start_date'] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start; |
|
| 648 | + $search_criteria[ 'start_date' ] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start; |
|
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | if ( ! empty( $curr_end ) ) { |
| 652 | 652 | // Fast-forward 24 hour on the end time |
| 653 | 653 | $curr_end = date( 'Y-m-d H:i:s', strtotime( $curr_end ) + DAY_IN_SECONDS ); |
| 654 | - $search_criteria['end_date'] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end; |
|
| 655 | - if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056 |
|
| 656 | - $search_criteria['end_date'] = date( 'Y-m-d H:i:s', strtotime( $search_criteria['end_date'] ) - 1 ); |
|
| 654 | + $search_criteria[ 'end_date' ] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end; |
|
| 655 | + if ( strpos( $search_criteria[ 'end_date' ], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056 |
|
| 656 | + $search_criteria[ 'end_date' ] = date( 'Y-m-d H:i:s', strtotime( $search_criteria[ 'end_date' ] ) - 1 ); |
|
| 657 | 657 | } |
| 658 | 658 | } |
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | // search for a specific entry ID |
| 662 | 662 | if ( ! empty( $get[ 'gv_id' ] ) && in_array( 'entry_id', $searchable_fields ) ) { |
| 663 | - $search_criteria['field_filters'][] = array( |
|
| 663 | + $search_criteria[ 'field_filters' ][ ] = array( |
|
| 664 | 664 | 'key' => 'id', |
| 665 | 665 | 'value' => absint( $get[ 'gv_id' ] ), |
| 666 | 666 | 'operator' => $this->get_operator( $get, 'gv_id', array( '=' ), '=' ), |
@@ -669,20 +669,20 @@ discard block |
||
| 669 | 669 | |
| 670 | 670 | // search for a specific Created_by ID |
| 671 | 671 | if ( ! empty( $get[ 'gv_by' ] ) && in_array( 'created_by', $searchable_fields ) ) { |
| 672 | - $search_criteria['field_filters'][] = array( |
|
| 672 | + $search_criteria[ 'field_filters' ][ ] = array( |
|
| 673 | 673 | 'key' => 'created_by', |
| 674 | - 'value' => $get['gv_by'], |
|
| 674 | + 'value' => $get[ 'gv_by' ], |
|
| 675 | 675 | 'operator' => $this->get_operator( $get, 'gv_by', array( '=' ), '=' ), |
| 676 | 676 | ); |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | 679 | // Get search mode passed in URL |
| 680 | - $mode = isset( $get['mode'] ) && in_array( $get['mode'], array( 'any', 'all' ) ) ? $get['mode'] : 'any'; |
|
| 680 | + $mode = isset( $get[ 'mode' ] ) && in_array( $get[ 'mode' ], array( 'any', 'all' ) ) ? $get[ 'mode' ] : 'any'; |
|
| 681 | 681 | |
| 682 | 682 | // get the other search filters |
| 683 | 683 | foreach ( $get as $key => $value ) { |
| 684 | 684 | |
| 685 | - if ( 0 !== strpos( $key, 'filter_' ) || gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[0], false, false ) ) ) { |
|
| 685 | + if ( 0 !== strpos( $key, 'filter_' ) || gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[ 0 ], false, false ) ) ) { |
|
| 686 | 686 | continue; // Not a filter, or empty |
| 687 | 687 | } |
| 688 | 688 | |
@@ -696,19 +696,19 @@ discard block |
||
| 696 | 696 | continue; |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | - if ( ! isset( $filter['operator'] ) ) { |
|
| 700 | - $filter['operator'] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' ); |
|
| 699 | + if ( ! isset( $filter[ 'operator' ] ) ) { |
|
| 700 | + $filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' ); |
|
| 701 | 701 | } |
| 702 | 702 | |
| 703 | - if ( isset( $filter[0]['value'] ) ) { |
|
| 704 | - $search_criteria['field_filters'] = array_merge( $search_criteria['field_filters'], $filter ); |
|
| 703 | + if ( isset( $filter[ 0 ][ 'value' ] ) ) { |
|
| 704 | + $search_criteria[ 'field_filters' ] = array_merge( $search_criteria[ 'field_filters' ], $filter ); |
|
| 705 | 705 | |
| 706 | 706 | // if date range type, set search mode to ALL |
| 707 | - if ( ! empty( $filter[0]['operator'] ) && in_array( $filter[0]['operator'], array( '>=', '<=', '>', '<' ) ) ) { |
|
| 707 | + if ( ! empty( $filter[ 0 ][ 'operator' ] ) && in_array( $filter[ 0 ][ 'operator' ], array( '>=', '<=', '>', '<' ) ) ) { |
|
| 708 | 708 | $mode = 'all'; |
| 709 | 709 | } |
| 710 | - } elseif( !empty( $filter ) ) { |
|
| 711 | - $search_criteria['field_filters'][] = $filter; |
|
| 710 | + } elseif ( ! empty( $filter ) ) { |
|
| 711 | + $search_criteria[ 'field_filters' ][ ] = $filter; |
|
| 712 | 712 | } |
| 713 | 713 | } |
| 714 | 714 | |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | * @since 1.5.1 |
| 718 | 718 | * @param[out,in] string $mode Search mode (`any` vs `all`) |
| 719 | 719 | */ |
| 720 | - $search_criteria['field_filters']['mode'] = apply_filters( 'gravityview/search/mode', $mode ); |
|
| 720 | + $search_criteria[ 'field_filters' ][ 'mode' ] = apply_filters( 'gravityview/search/mode', $mode ); |
|
| 721 | 721 | |
| 722 | 722 | gravityview()->log->debug( 'Returned Search Criteria: ', array( 'data' => $search_criteria ) ); |
| 723 | 723 | |
@@ -751,19 +751,19 @@ discard block |
||
| 751 | 751 | |
| 752 | 752 | $query_class = $view->get_query_class(); |
| 753 | 753 | |
| 754 | - if ( empty( $search_criteria['field_filters'] ) ) { |
|
| 754 | + if ( empty( $search_criteria[ 'field_filters' ] ) ) { |
|
| 755 | 755 | return; |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | $widgets = $view->widgets->by_id( $this->widget_id ); |
| 759 | 759 | if ( $widgets->count() ) { |
| 760 | 760 | $widgets = $widgets->all(); |
| 761 | - $widget = $widgets[0]; |
|
| 761 | + $widget = $widgets[ 0 ]; |
|
| 762 | 762 | |
| 763 | 763 | $search_fields = json_decode( $widget->configuration->get( 'search_fields' ), true ); |
| 764 | 764 | |
| 765 | - foreach ( (array) $search_fields as $search_field ) { |
|
| 766 | - if ( 'created_by' === $search_field['field'] && 'input_text' === $search_field['input'] ) { |
|
| 765 | + foreach ( (array)$search_fields as $search_field ) { |
|
| 766 | + if ( 'created_by' === $search_field[ 'field' ] && 'input_text' === $search_field[ 'input' ] ) { |
|
| 767 | 767 | $created_by_text_mode = true; |
| 768 | 768 | } |
| 769 | 769 | } |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | $extra_conditions = array(); |
| 773 | 773 | $mode = 'any'; |
| 774 | 774 | |
| 775 | - foreach ( $search_criteria['field_filters'] as &$filter ) { |
|
| 775 | + foreach ( $search_criteria[ 'field_filters' ] as &$filter ) { |
|
| 776 | 776 | if ( ! is_array( $filter ) ) { |
| 777 | 777 | if ( in_array( strtolower( $filter ), array( 'any', 'all' ) ) ) { |
| 778 | 778 | $mode = $filter; |
@@ -781,13 +781,13 @@ discard block |
||
| 781 | 781 | } |
| 782 | 782 | |
| 783 | 783 | // Construct a manual query for unapproved statuses |
| 784 | - if ( 'is_approved' === $filter['key'] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array) $filter['value'] ) ) { |
|
| 785 | - $_tmp_query = new $query_class( $view->form->ID, array( |
|
| 784 | + if ( 'is_approved' === $filter[ 'key' ] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array)$filter[ 'value' ] ) ) { |
|
| 785 | + $_tmp_query = new $query_class( $view->form->ID, array( |
|
| 786 | 786 | 'field_filters' => array( |
| 787 | 787 | array( |
| 788 | 788 | 'operator' => 'in', |
| 789 | 789 | 'key' => 'is_approved', |
| 790 | - 'value' => (array) $filter['value'], |
|
| 790 | + 'value' => (array)$filter[ 'value' ], |
|
| 791 | 791 | ), |
| 792 | 792 | array( |
| 793 | 793 | 'operator' => 'is', |
@@ -799,30 +799,30 @@ discard block |
||
| 799 | 799 | ) ); |
| 800 | 800 | $_tmp_query_parts = $_tmp_query->_introspect(); |
| 801 | 801 | |
| 802 | - $extra_conditions[] = $_tmp_query_parts['where']; |
|
| 802 | + $extra_conditions[ ] = $_tmp_query_parts[ 'where' ]; |
|
| 803 | 803 | |
| 804 | 804 | $filter = false; |
| 805 | 805 | continue; |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | // Construct manual query for text mode creator search |
| 809 | - if ( 'created_by' === $filter['key'] && ! empty( $created_by_text_mode ) ) { |
|
| 810 | - $extra_conditions[] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view ); |
|
| 809 | + if ( 'created_by' === $filter[ 'key' ] && ! empty( $created_by_text_mode ) ) { |
|
| 810 | + $extra_conditions[ ] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view ); |
|
| 811 | 811 | $filter = false; |
| 812 | 812 | continue; |
| 813 | 813 | } |
| 814 | 814 | |
| 815 | 815 | // By default, we want searches to be wildcard for each field. |
| 816 | - $filter['operator'] = empty( $filter['operator'] ) ? 'contains' : $filter['operator']; |
|
| 816 | + $filter[ 'operator' ] = empty( $filter[ 'operator' ] ) ? 'contains' : $filter[ 'operator' ]; |
|
| 817 | 817 | |
| 818 | 818 | // For multichoice, let's have an in (OR) search. |
| 819 | - if ( is_array( $filter['value'] ) ) { |
|
| 820 | - $filter['operator'] = 'in'; // @todo what about in contains (OR LIKE chains)? |
|
| 819 | + if ( is_array( $filter[ 'value' ] ) ) { |
|
| 820 | + $filter[ 'operator' ] = 'in'; // @todo what about in contains (OR LIKE chains)? |
|
| 821 | 821 | } |
| 822 | 822 | |
| 823 | 823 | // Default form with joins functionality |
| 824 | - if ( empty( $filter['form_id'] ) ) { |
|
| 825 | - $filter['form_id'] = $view->form ? $view->form->ID : 0; |
|
| 824 | + if ( empty( $filter[ 'form_id' ] ) ) { |
|
| 825 | + $filter[ 'form_id' ] = $view->form ? $view->form->ID : 0; |
|
| 826 | 826 | } |
| 827 | 827 | |
| 828 | 828 | /** |
@@ -832,28 +832,28 @@ discard block |
||
| 832 | 832 | * @since develop |
| 833 | 833 | * @param \GV\View $view The View we're operating on. |
| 834 | 834 | */ |
| 835 | - $filter['operator'] = apply_filters( 'gravityview_search_operator', $filter['operator'], $filter, $view ); |
|
| 835 | + $filter[ 'operator' ] = apply_filters( 'gravityview_search_operator', $filter[ 'operator' ], $filter, $view ); |
|
| 836 | 836 | } |
| 837 | 837 | |
| 838 | - if ( ! empty( $search_criteria['start_date'] ) || ! empty( $search_criteria['end_date'] ) ) { |
|
| 838 | + if ( ! empty( $search_criteria[ 'start_date' ] ) || ! empty( $search_criteria[ 'end_date' ] ) ) { |
|
| 839 | 839 | $date_criteria = array(); |
| 840 | 840 | |
| 841 | - if ( isset( $search_criteria['start_date'] ) ) { |
|
| 842 | - $date_criteria['start_date'] = $search_criteria['start_date']; |
|
| 841 | + if ( isset( $search_criteria[ 'start_date' ] ) ) { |
|
| 842 | + $date_criteria[ 'start_date' ] = $search_criteria[ 'start_date' ]; |
|
| 843 | 843 | } |
| 844 | 844 | |
| 845 | - if ( isset( $search_criteria['end_date'] ) ) { |
|
| 846 | - $date_criteria['end_date'] = $search_criteria['end_date']; |
|
| 845 | + if ( isset( $search_criteria[ 'end_date' ] ) ) { |
|
| 846 | + $date_criteria[ 'end_date' ] = $search_criteria[ 'end_date' ]; |
|
| 847 | 847 | } |
| 848 | 848 | |
| 849 | 849 | $_tmp_query = new $query_class( $view->form->ID, $date_criteria ); |
| 850 | 850 | $_tmp_query_parts = $_tmp_query->_introspect(); |
| 851 | - $extra_conditions[] = $_tmp_query_parts['where']; |
|
| 851 | + $extra_conditions[ ] = $_tmp_query_parts[ 'where' ]; |
|
| 852 | 852 | } |
| 853 | 853 | |
| 854 | 854 | $search_conditions = array(); |
| 855 | 855 | |
| 856 | - if ( $filters = array_filter( $search_criteria['field_filters'] ) ) { |
|
| 856 | + if ( $filters = array_filter( $search_criteria[ 'field_filters' ] ) ) { |
|
| 857 | 857 | |
| 858 | 858 | foreach ( $filters as $filter ) { |
| 859 | 859 | if ( ! is_array( $filter ) ) { |
@@ -866,22 +866,22 @@ discard block |
||
| 866 | 866 | * code by reusing what's inside GF_Query already as they |
| 867 | 867 | * take care of many small things like forcing numeric, etc. |
| 868 | 868 | */ |
| 869 | - $_tmp_query = new $query_class( $filter['form_id'], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) ); |
|
| 869 | + $_tmp_query = new $query_class( $filter[ 'form_id' ], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) ); |
|
| 870 | 870 | $_tmp_query_parts = $_tmp_query->_introspect(); |
| 871 | - $search_condition = $_tmp_query_parts['where']; |
|
| 871 | + $search_condition = $_tmp_query_parts[ 'where' ]; |
|
| 872 | 872 | |
| 873 | - if ( empty( $filter['key'] ) && $search_condition->expressions ) { |
|
| 873 | + if ( empty( $filter[ 'key' ] ) && $search_condition->expressions ) { |
|
| 874 | 874 | foreach ( $search_condition->expressions as $condition ) { |
| 875 | - $search_conditions[] = new GravityView_Widget_Search_All_GF_Query_Condition( $condition, $view ); |
|
| 875 | + $search_conditions[ ] = new GravityView_Widget_Search_All_GF_Query_Condition( $condition, $view ); |
|
| 876 | 876 | } |
| 877 | 877 | } else { |
| 878 | 878 | $left = $search_condition->left; |
| 879 | 879 | $alias = $query->_alias( $left->field_id, $left->source, $left->is_entry_column() ? 't' : 'm' ); |
| 880 | 880 | |
| 881 | 881 | if ( $view->joins && $left->field_id == GF_Query_Column::META ) { |
| 882 | - $search_conditions[] = new GravityView_Widget_Search_All_GF_Query_Condition( $search_condition, $view ); |
|
| 882 | + $search_conditions[ ] = new GravityView_Widget_Search_All_GF_Query_Condition( $search_condition, $view ); |
|
| 883 | 883 | } else { |
| 884 | - $search_conditions[] = new GF_Query_Condition( |
|
| 884 | + $search_conditions[ ] = new GF_Query_Condition( |
|
| 885 | 885 | new GF_Query_Column( $left->field_id, $left->source, $alias ), |
| 886 | 886 | $search_condition->operator, |
| 887 | 887 | $search_condition->right |
@@ -903,7 +903,7 @@ discard block |
||
| 903 | 903 | /** |
| 904 | 904 | * Combine the parts as a new WHERE clause. |
| 905 | 905 | */ |
| 906 | - $where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts['where'] ), $search_conditions, $extra_conditions ) ); |
|
| 906 | + $where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts[ 'where' ] ), $search_conditions, $extra_conditions ) ); |
|
| 907 | 907 | $query->where( $where ); |
| 908 | 908 | } |
| 909 | 909 | |
@@ -926,7 +926,7 @@ discard block |
||
| 926 | 926 | $field_id = str_replace( 'filter_', '', $key ); |
| 927 | 927 | |
| 928 | 928 | // calculates field_id, removing 'filter_' and for '_' for advanced fields ( like name or checkbox ) |
| 929 | - if ( preg_match('/^[0-9_]+$/ism', $field_id ) ) { |
|
| 929 | + if ( preg_match( '/^[0-9_]+$/ism', $field_id ) ) { |
|
| 930 | 930 | $field_id = str_replace( '_', '.', $field_id ); |
| 931 | 931 | } |
| 932 | 932 | |
@@ -983,7 +983,7 @@ discard block |
||
| 983 | 983 | // form is in searchable fields |
| 984 | 984 | $found = false; |
| 985 | 985 | foreach ( $searchable_fields as $field ) { |
| 986 | - if ( $field_id == $field['field'] && $form->ID == $field['form_id'] ) { |
|
| 986 | + if ( $field_id == $field[ 'field' ] && $form->ID == $field[ 'form_id' ] ) { |
|
| 987 | 987 | $found = true; |
| 988 | 988 | break; |
| 989 | 989 | } |
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | |
| 1020 | 1020 | case 'select': |
| 1021 | 1021 | case 'radio': |
| 1022 | - $filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' ); |
|
| 1022 | + $filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' ); |
|
| 1023 | 1023 | break; |
| 1024 | 1024 | |
| 1025 | 1025 | case 'post_category': |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | |
| 1034 | 1034 | foreach ( $value as $val ) { |
| 1035 | 1035 | $cat = get_term( $val, 'category' ); |
| 1036 | - $filter[] = array( |
|
| 1036 | + $filter[ ] = array( |
|
| 1037 | 1037 | 'key' => $field_id, |
| 1038 | 1038 | 'value' => esc_attr( $cat->name ) . ':' . $val, |
| 1039 | 1039 | 'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ), |
@@ -1052,7 +1052,7 @@ discard block |
||
| 1052 | 1052 | $filter = array(); |
| 1053 | 1053 | |
| 1054 | 1054 | foreach ( $value as $val ) { |
| 1055 | - $filter[] = array( 'key' => $field_id, 'value' => $val ); |
|
| 1055 | + $filter[ ] = array( 'key' => $field_id, 'value' => $val ); |
|
| 1056 | 1056 | } |
| 1057 | 1057 | |
| 1058 | 1058 | break; |
@@ -1061,9 +1061,9 @@ discard block |
||
| 1061 | 1061 | // convert checkbox on/off into the correct search filter |
| 1062 | 1062 | if ( false !== strpos( $field_id, '.' ) && ! empty( $form_field->inputs ) && ! empty( $form_field->choices ) ) { |
| 1063 | 1063 | foreach ( $form_field->inputs as $k => $input ) { |
| 1064 | - if ( $input['id'] == $field_id ) { |
|
| 1065 | - $filter['value'] = $form_field->choices[ $k ]['value']; |
|
| 1066 | - $filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' ); |
|
| 1064 | + if ( $input[ 'id' ] == $field_id ) { |
|
| 1065 | + $filter[ 'value' ] = $form_field->choices[ $k ][ 'value' ]; |
|
| 1066 | + $filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' ); |
|
| 1067 | 1067 | break; |
| 1068 | 1068 | } |
| 1069 | 1069 | } |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | $filter = array(); |
| 1074 | 1074 | |
| 1075 | 1075 | foreach ( $value as $val ) { |
| 1076 | - $filter[] = array( |
|
| 1076 | + $filter[ ] = array( |
|
| 1077 | 1077 | 'key' => $field_id, |
| 1078 | 1078 | 'value' => $val, |
| 1079 | 1079 | 'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ), |
@@ -1094,9 +1094,9 @@ discard block |
||
| 1094 | 1094 | foreach ( $words as $word ) { |
| 1095 | 1095 | if ( ! empty( $word ) && strlen( $word ) > 1 ) { |
| 1096 | 1096 | // Keep the same key for each filter |
| 1097 | - $filter['value'] = $word; |
|
| 1097 | + $filter[ 'value' ] = $word; |
|
| 1098 | 1098 | // Add a search for the value |
| 1099 | - $filters[] = $filter; |
|
| 1099 | + $filters[ ] = $filter; |
|
| 1100 | 1100 | } |
| 1101 | 1101 | } |
| 1102 | 1102 | |
@@ -1110,19 +1110,19 @@ discard block |
||
| 1110 | 1110 | |
| 1111 | 1111 | foreach ( $searchable_fields as $searchable_field ) { |
| 1112 | 1112 | |
| 1113 | - if( $form_field->ID !== $searchable_field['field'] ) { |
|
| 1113 | + if ( $form_field->ID !== $searchable_field[ 'field' ] ) { |
|
| 1114 | 1114 | continue; |
| 1115 | 1115 | } |
| 1116 | 1116 | |
| 1117 | 1117 | // Only exact-match dropdowns, not text search |
| 1118 | - if( in_array( $searchable_field['input'], array( 'text', 'search' ), true ) ) { |
|
| 1118 | + if ( in_array( $searchable_field[ 'input' ], array( 'text', 'search' ), true ) ) { |
|
| 1119 | 1119 | continue; |
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | 1122 | $input_id = gravityview_get_input_id_from_id( $form_field->ID ); |
| 1123 | 1123 | |
| 1124 | 1124 | if ( 4 === $input_id ) { |
| 1125 | - $filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' ); |
|
| 1125 | + $filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' ); |
|
| 1126 | 1126 | }; |
| 1127 | 1127 | } |
| 1128 | 1128 | } |
@@ -1149,12 +1149,12 @@ discard block |
||
| 1149 | 1149 | * @since 1.16.3 |
| 1150 | 1150 | * Safeguard until GF implements '<=' operator |
| 1151 | 1151 | */ |
| 1152 | - if( !GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) { |
|
| 1152 | + if ( ! GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) { |
|
| 1153 | 1153 | $operator = '<'; |
| 1154 | 1154 | $date = date( 'Y-m-d', strtotime( self::get_formatted_date( $date, 'Y-m-d', $date_format ) . ' +1 day' ) ); |
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | - $filter[] = array( |
|
| 1157 | + $filter[ ] = array( |
|
| 1158 | 1158 | 'key' => $field_id, |
| 1159 | 1159 | 'value' => self::get_formatted_date( $date, 'Y-m-d', $date_format ), |
| 1160 | 1160 | 'operator' => $this->get_operator( $get, $key, array( $operator ), $operator ), |
@@ -1162,8 +1162,8 @@ discard block |
||
| 1162 | 1162 | } |
| 1163 | 1163 | } else { |
| 1164 | 1164 | $date = $value; |
| 1165 | - $filter['value'] = self::get_formatted_date( $date, 'Y-m-d', $date_format ); |
|
| 1166 | - $filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' ); |
|
| 1165 | + $filter[ 'value' ] = self::get_formatted_date( $date, 'Y-m-d', $date_format ); |
|
| 1166 | + $filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' ); |
|
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | 1169 | break; |
@@ -1194,7 +1194,7 @@ discard block |
||
| 1194 | 1194 | 'ymd_dot' => 'Y.m.d', |
| 1195 | 1195 | ); |
| 1196 | 1196 | |
| 1197 | - if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){ |
|
| 1197 | + if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) { |
|
| 1198 | 1198 | $format = $datepicker[ $field->dateFormat ]; |
| 1199 | 1199 | } |
| 1200 | 1200 | |
@@ -1231,7 +1231,7 @@ discard block |
||
| 1231 | 1231 | public function add_template_path( $file_paths ) { |
| 1232 | 1232 | |
| 1233 | 1233 | // Index 100 is the default GravityView template path. |
| 1234 | - $file_paths[102] = self::$file . 'templates/'; |
|
| 1234 | + $file_paths[ 102 ] = self::$file . 'templates/'; |
|
| 1235 | 1235 | |
| 1236 | 1236 | return $file_paths; |
| 1237 | 1237 | } |
@@ -1250,7 +1250,7 @@ discard block |
||
| 1250 | 1250 | $has_date = false; |
| 1251 | 1251 | |
| 1252 | 1252 | foreach ( $search_fields as $k => $field ) { |
| 1253 | - if ( in_array( $field['input'], array( 'date', 'date_range', 'entry_date' ) ) ) { |
|
| 1253 | + if ( in_array( $field[ 'input' ], array( 'date', 'date_range', 'entry_date' ) ) ) { |
|
| 1254 | 1254 | $has_date = true; |
| 1255 | 1255 | break; |
| 1256 | 1256 | } |
@@ -1277,7 +1277,7 @@ discard block |
||
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | 1279 | // get configured search fields |
| 1280 | - $search_fields = ! empty( $widget_args['search_fields'] ) ? json_decode( $widget_args['search_fields'], true ) : ''; |
|
| 1280 | + $search_fields = ! empty( $widget_args[ 'search_fields' ] ) ? json_decode( $widget_args[ 'search_fields' ], true ) : ''; |
|
| 1281 | 1281 | |
| 1282 | 1282 | if ( empty( $search_fields ) || ! is_array( $search_fields ) ) { |
| 1283 | 1283 | gravityview()->log->debug( 'No search fields configured for widget:', array( 'data' => $widget_args ) ); |
@@ -1293,40 +1293,40 @@ discard block |
||
| 1293 | 1293 | |
| 1294 | 1294 | $updated_field = $this->get_search_filter_details( $updated_field ); |
| 1295 | 1295 | |
| 1296 | - switch ( $field['field'] ) { |
|
| 1296 | + switch ( $field[ 'field' ] ) { |
|
| 1297 | 1297 | |
| 1298 | 1298 | case 'search_all': |
| 1299 | - $updated_field['key'] = 'search_all'; |
|
| 1300 | - $updated_field['input'] = 'search_all'; |
|
| 1301 | - $updated_field['value'] = $this->rgget_or_rgpost( 'gv_search' ); |
|
| 1299 | + $updated_field[ 'key' ] = 'search_all'; |
|
| 1300 | + $updated_field[ 'input' ] = 'search_all'; |
|
| 1301 | + $updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_search' ); |
|
| 1302 | 1302 | break; |
| 1303 | 1303 | |
| 1304 | 1304 | case 'entry_date': |
| 1305 | - $updated_field['key'] = 'entry_date'; |
|
| 1306 | - $updated_field['input'] = 'entry_date'; |
|
| 1307 | - $updated_field['value'] = array( |
|
| 1305 | + $updated_field[ 'key' ] = 'entry_date'; |
|
| 1306 | + $updated_field[ 'input' ] = 'entry_date'; |
|
| 1307 | + $updated_field[ 'value' ] = array( |
|
| 1308 | 1308 | 'start' => $this->rgget_or_rgpost( 'gv_start' ), |
| 1309 | 1309 | 'end' => $this->rgget_or_rgpost( 'gv_end' ), |
| 1310 | 1310 | ); |
| 1311 | 1311 | break; |
| 1312 | 1312 | |
| 1313 | 1313 | case 'entry_id': |
| 1314 | - $updated_field['key'] = 'entry_id'; |
|
| 1315 | - $updated_field['input'] = 'entry_id'; |
|
| 1316 | - $updated_field['value'] = $this->rgget_or_rgpost( 'gv_id' ); |
|
| 1314 | + $updated_field[ 'key' ] = 'entry_id'; |
|
| 1315 | + $updated_field[ 'input' ] = 'entry_id'; |
|
| 1316 | + $updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_id' ); |
|
| 1317 | 1317 | break; |
| 1318 | 1318 | |
| 1319 | 1319 | case 'created_by': |
| 1320 | - $updated_field['key'] = 'created_by'; |
|
| 1321 | - $updated_field['name'] = 'gv_by'; |
|
| 1322 | - $updated_field['value'] = $this->rgget_or_rgpost( 'gv_by' ); |
|
| 1323 | - $updated_field['choices'] = self::get_created_by_choices( $view ); |
|
| 1320 | + $updated_field[ 'key' ] = 'created_by'; |
|
| 1321 | + $updated_field[ 'name' ] = 'gv_by'; |
|
| 1322 | + $updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_by' ); |
|
| 1323 | + $updated_field[ 'choices' ] = self::get_created_by_choices( $view ); |
|
| 1324 | 1324 | break; |
| 1325 | 1325 | |
| 1326 | 1326 | case 'is_approved': |
| 1327 | - $updated_field['key'] = 'is_approved'; |
|
| 1328 | - $updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_approved' ); |
|
| 1329 | - $updated_field['choices'] = self::get_is_approved_choices(); |
|
| 1327 | + $updated_field[ 'key' ] = 'is_approved'; |
|
| 1328 | + $updated_field[ 'value' ] = $this->rgget_or_rgpost( 'filter_is_approved' ); |
|
| 1329 | + $updated_field[ 'choices' ] = self::get_is_approved_choices(); |
|
| 1330 | 1330 | break; |
| 1331 | 1331 | } |
| 1332 | 1332 | |
@@ -1345,16 +1345,16 @@ discard block |
||
| 1345 | 1345 | */ |
| 1346 | 1346 | $gravityview_view->search_fields = apply_filters( 'gravityview_widget_search_filters', $search_fields, $this, $widget_args, $context ); |
| 1347 | 1347 | |
| 1348 | - $gravityview_view->search_layout = ! empty( $widget_args['search_layout'] ) ? $widget_args['search_layout'] : 'horizontal'; |
|
| 1348 | + $gravityview_view->search_layout = ! empty( $widget_args[ 'search_layout' ] ) ? $widget_args[ 'search_layout' ] : 'horizontal'; |
|
| 1349 | 1349 | |
| 1350 | 1350 | /** @since 1.14 */ |
| 1351 | - $gravityview_view->search_mode = ! empty( $widget_args['search_mode'] ) ? $widget_args['search_mode'] : 'any'; |
|
| 1351 | + $gravityview_view->search_mode = ! empty( $widget_args[ 'search_mode' ] ) ? $widget_args[ 'search_mode' ] : 'any'; |
|
| 1352 | 1352 | |
| 1353 | - $custom_class = ! empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : ''; |
|
| 1353 | + $custom_class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : ''; |
|
| 1354 | 1354 | |
| 1355 | 1355 | $gravityview_view->search_class = self::get_search_class( $custom_class ); |
| 1356 | 1356 | |
| 1357 | - $gravityview_view->search_clear = ! empty( $widget_args['search_clear'] ) ? $widget_args['search_clear'] : false; |
|
| 1357 | + $gravityview_view->search_clear = ! empty( $widget_args[ 'search_clear' ] ) ? $widget_args[ 'search_clear' ] : false; |
|
| 1358 | 1358 | |
| 1359 | 1359 | if ( $this->has_date_field( $search_fields ) ) { |
| 1360 | 1360 | // enqueue datepicker stuff only if needed! |
@@ -1376,10 +1376,10 @@ discard block |
||
| 1376 | 1376 | public static function get_search_class( $custom_class = '' ) { |
| 1377 | 1377 | $gravityview_view = GravityView_View::getInstance(); |
| 1378 | 1378 | |
| 1379 | - $search_class = 'gv-search-'.$gravityview_view->search_layout; |
|
| 1379 | + $search_class = 'gv-search-' . $gravityview_view->search_layout; |
|
| 1380 | 1380 | |
| 1381 | - if ( ! empty( $custom_class ) ) { |
|
| 1382 | - $search_class .= ' '.$custom_class; |
|
| 1381 | + if ( ! empty( $custom_class ) ) { |
|
| 1382 | + $search_class .= ' ' . $custom_class; |
|
| 1383 | 1383 | } |
| 1384 | 1384 | |
| 1385 | 1385 | /** |
@@ -1423,9 +1423,9 @@ discard block |
||
| 1423 | 1423 | |
| 1424 | 1424 | if ( ! $label ) { |
| 1425 | 1425 | |
| 1426 | - $label = isset( $form_field['label'] ) ? $form_field['label'] : ''; |
|
| 1426 | + $label = isset( $form_field[ 'label' ] ) ? $form_field[ 'label' ] : ''; |
|
| 1427 | 1427 | |
| 1428 | - switch( $field['field'] ) { |
|
| 1428 | + switch ( $field[ 'field' ] ) { |
|
| 1429 | 1429 | case 'search_all': |
| 1430 | 1430 | $label = __( 'Search Entries:', 'gravityview' ); |
| 1431 | 1431 | break; |
@@ -1437,10 +1437,10 @@ discard block |
||
| 1437 | 1437 | break; |
| 1438 | 1438 | default: |
| 1439 | 1439 | // If this is a field input, not a field |
| 1440 | - if ( strpos( $field['field'], '.' ) > 0 && ! empty( $form_field['inputs'] ) ) { |
|
| 1440 | + if ( strpos( $field[ 'field' ], '.' ) > 0 && ! empty( $form_field[ 'inputs' ] ) ) { |
|
| 1441 | 1441 | |
| 1442 | 1442 | // Get the label for the field in question, which returns an array |
| 1443 | - $items = wp_list_filter( $form_field['inputs'], array( 'id' => $field['field'] ) ); |
|
| 1443 | + $items = wp_list_filter( $form_field[ 'inputs' ], array( 'id' => $field[ 'field' ] ) ); |
|
| 1444 | 1444 | |
| 1445 | 1445 | // Get the item with the `label` key |
| 1446 | 1446 | $values = wp_list_pluck( $items, 'label' ); |
@@ -1479,32 +1479,32 @@ discard block |
||
| 1479 | 1479 | $form = $gravityview_view->getForm(); |
| 1480 | 1480 | |
| 1481 | 1481 | // for advanced field ids (eg, first name / last name ) |
| 1482 | - $name = 'filter_' . str_replace( '.', '_', $field['field'] ); |
|
| 1482 | + $name = 'filter_' . str_replace( '.', '_', $field[ 'field' ] ); |
|
| 1483 | 1483 | |
| 1484 | 1484 | // get searched value from $_GET/$_POST (string or array) |
| 1485 | 1485 | $value = $this->rgget_or_rgpost( $name ); |
| 1486 | 1486 | |
| 1487 | 1487 | // get form field details |
| 1488 | - $form_field = gravityview_get_field( $form, $field['field'] ); |
|
| 1488 | + $form_field = gravityview_get_field( $form, $field[ 'field' ] ); |
|
| 1489 | 1489 | |
| 1490 | 1490 | $filter = array( |
| 1491 | - 'key' => $field['field'], |
|
| 1491 | + 'key' => $field[ 'field' ], |
|
| 1492 | 1492 | 'name' => $name, |
| 1493 | 1493 | 'label' => self::get_field_label( $field, $form_field ), |
| 1494 | - 'input' => $field['input'], |
|
| 1494 | + 'input' => $field[ 'input' ], |
|
| 1495 | 1495 | 'value' => $value, |
| 1496 | - 'type' => $form_field['type'], |
|
| 1496 | + 'type' => $form_field[ 'type' ], |
|
| 1497 | 1497 | ); |
| 1498 | 1498 | |
| 1499 | 1499 | // collect choices |
| 1500 | - if ( 'post_category' === $form_field['type'] && ! empty( $form_field['displayAllCategories'] ) && empty( $form_field['choices'] ) ) { |
|
| 1501 | - $filter['choices'] = gravityview_get_terms_choices(); |
|
| 1502 | - } elseif ( ! empty( $form_field['choices'] ) ) { |
|
| 1503 | - $filter['choices'] = $form_field['choices']; |
|
| 1500 | + if ( 'post_category' === $form_field[ 'type' ] && ! empty( $form_field[ 'displayAllCategories' ] ) && empty( $form_field[ 'choices' ] ) ) { |
|
| 1501 | + $filter[ 'choices' ] = gravityview_get_terms_choices(); |
|
| 1502 | + } elseif ( ! empty( $form_field[ 'choices' ] ) ) { |
|
| 1503 | + $filter[ 'choices' ] = $form_field[ 'choices' ]; |
|
| 1504 | 1504 | } |
| 1505 | 1505 | |
| 1506 | - if ( 'date_range' === $field['input'] && empty( $value ) ) { |
|
| 1507 | - $filter['value'] = array( 'start' => '', 'end' => '' ); |
|
| 1506 | + if ( 'date_range' === $field[ 'input' ] && empty( $value ) ) { |
|
| 1507 | + $filter[ 'value' ] = array( 'start' => '', 'end' => '' ); |
|
| 1508 | 1508 | } |
| 1509 | 1509 | |
| 1510 | 1510 | return $filter; |
@@ -1539,7 +1539,7 @@ discard block |
||
| 1539 | 1539 | * @param \GV\View $view The view. |
| 1540 | 1540 | */ |
| 1541 | 1541 | $text = apply_filters( 'gravityview/search/created_by/text', $user->display_name, $user, $view ); |
| 1542 | - $choices[] = array( |
|
| 1542 | + $choices[ ] = array( |
|
| 1543 | 1543 | 'value' => $user->ID, |
| 1544 | 1544 | 'text' => $text, |
| 1545 | 1545 | ); |
@@ -1559,9 +1559,9 @@ discard block |
||
| 1559 | 1559 | |
| 1560 | 1560 | $choices = array(); |
| 1561 | 1561 | foreach ( GravityView_Entry_Approval_Status::get_all() as $status ) { |
| 1562 | - $choices[] = array( |
|
| 1563 | - 'value' => $status['value'], |
|
| 1564 | - 'text' => $status['label'], |
|
| 1562 | + $choices[ ] = array( |
|
| 1563 | + 'value' => $status[ 'value' ], |
|
| 1564 | + 'text' => $status[ 'label' ], |
|
| 1565 | 1565 | ); |
| 1566 | 1566 | } |
| 1567 | 1567 | |
@@ -1613,7 +1613,7 @@ discard block |
||
| 1613 | 1613 | */ |
| 1614 | 1614 | public function add_datepicker_js_dependency( $js_dependencies ) { |
| 1615 | 1615 | |
| 1616 | - $js_dependencies[] = 'jquery-ui-datepicker'; |
|
| 1616 | + $js_dependencies[ ] = 'jquery-ui-datepicker'; |
|
| 1617 | 1617 | |
| 1618 | 1618 | return $js_dependencies; |
| 1619 | 1619 | } |
@@ -1657,7 +1657,7 @@ discard block |
||
| 1657 | 1657 | 'isRTL' => is_rtl(), |
| 1658 | 1658 | ), $view_data ); |
| 1659 | 1659 | |
| 1660 | - $localizations['datepicker'] = $datepicker_settings; |
|
| 1660 | + $localizations[ 'datepicker' ] = $datepicker_settings; |
|
| 1661 | 1661 | |
| 1662 | 1662 | return $localizations; |
| 1663 | 1663 | |
@@ -1684,7 +1684,7 @@ discard block |
||
| 1684 | 1684 | * @return void |
| 1685 | 1685 | */ |
| 1686 | 1686 | private function maybe_enqueue_flexibility() { |
| 1687 | - if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/MSIE [8-9]/', $_SERVER['HTTP_USER_AGENT'] ) ) { |
|
| 1687 | + if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) && preg_match( '/MSIE [8-9]/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) { |
|
| 1688 | 1688 | wp_enqueue_script( 'gv-flexibility' ); |
| 1689 | 1689 | } |
| 1690 | 1690 | } |
@@ -1706,7 +1706,7 @@ discard block |
||
| 1706 | 1706 | add_filter( 'gravityview_js_localization', array( $this, 'add_datepicker_localization' ), 10, 2 ); |
| 1707 | 1707 | |
| 1708 | 1708 | $scheme = is_ssl() ? 'https://' : 'http://'; |
| 1709 | - wp_enqueue_style( 'jquery-ui-datepicker', $scheme.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' ); |
|
| 1709 | + wp_enqueue_style( 'jquery-ui-datepicker', $scheme . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' ); |
|
| 1710 | 1710 | |
| 1711 | 1711 | /** |
| 1712 | 1712 | * @filter `gravityview_search_datepicker_class` |
@@ -1785,7 +1785,7 @@ discard block |
||
| 1785 | 1785 | public function add_preview_inputs() { |
| 1786 | 1786 | global $wp; |
| 1787 | 1787 | |
| 1788 | - if ( ! is_preview() || ! current_user_can( 'publish_gravityviews') ) { |
|
| 1788 | + if ( ! is_preview() || ! current_user_can( 'publish_gravityviews' ) ) { |
|
| 1789 | 1789 | return; |
| 1790 | 1790 | } |
| 1791 | 1791 | |
@@ -1837,7 +1837,7 @@ discard block |
||
| 1837 | 1837 | */ |
| 1838 | 1838 | class GravityView_Widget_Search_Author_GF_Query_Condition extends \GF_Query_Condition { |
| 1839 | 1839 | public function __construct( $filter, $view ) { |
| 1840 | - $this->value = $filter['value']; |
|
| 1840 | + $this->value = $filter[ 'value' ]; |
|
| 1841 | 1841 | $this->view = $view; |
| 1842 | 1842 | } |
| 1843 | 1843 | |
@@ -1869,11 +1869,11 @@ discard block |
||
| 1869 | 1869 | $conditions = array(); |
| 1870 | 1870 | |
| 1871 | 1871 | foreach ( $user_fields as $user_field ) { |
| 1872 | - $conditions[] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) . '%' ); |
|
| 1872 | + $conditions[ ] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) . '%' ); |
|
| 1873 | 1873 | } |
| 1874 | 1874 | |
| 1875 | 1875 | foreach ( $user_meta_fields as $meta_field ) { |
| 1876 | - $conditions[] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) . '%' ); |
|
| 1876 | + $conditions[ ] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) . '%' ); |
|
| 1877 | 1877 | } |
| 1878 | 1878 | |
| 1879 | 1879 | $conditions = '(' . implode( ' OR ', $conditions ) . ')'; |
@@ -1902,9 +1902,9 @@ discard block |
||
| 1902 | 1902 | |
| 1903 | 1903 | $conditions = array(); |
| 1904 | 1904 | |
| 1905 | - foreach ( $parameters['aliases'] as $key => $alias ) { |
|
| 1906 | - if ( 'm' == $alias[0] && preg_match( '#\d+_\d+#', $key ) ) { |
|
| 1907 | - $conditions[] = sprintf( "EXISTS(SELECT * FROM `$table` WHERE `meta_value` %s %s AND `entry_id` = `%s`.`entry_id`)", |
|
| 1905 | + foreach ( $parameters[ 'aliases' ] as $key => $alias ) { |
|
| 1906 | + if ( 'm' == $alias[ 0 ] && preg_match( '#\d+_\d+#', $key ) ) { |
|
| 1907 | + $conditions[ ] = sprintf( "EXISTS(SELECT * FROM `$table` WHERE `meta_value` %s %s AND `entry_id` = `%s`.`entry_id`)", |
|
| 1908 | 1908 | $this->search_condition->operator, $this->search_condition->right->sql( $query ), $alias ); |
| 1909 | 1909 | } |
| 1910 | 1910 | } |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | * @see \Gamajo_Template_Loader::set_template_data |
| 85 | 85 | * @see \GV\Template::pop_template_data |
| 86 | 86 | * |
| 87 | - * @return \Gamajo_Template_Loader The current instance. |
|
| 87 | + * @return Template The current instance. |
|
| 88 | 88 | */ |
| 89 | 89 | public function push_template_data( $data, $var_name = 'data' ) { |
| 90 | 90 | if ( ! isset( self::$data_stack[ $var_name ] ) ) { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | function modify_entry_value_workflow_final_status( $output, $entry, $field_settings, $field ) { |
| 43 | 43 | |
| 44 | - if( ! empty( $output ) ) { |
|
| 44 | + if ( ! empty( $output ) ) { |
|
| 45 | 45 | $output = gravity_flow()->translate_status_label( $output ); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | foreach ( $search_fields as & $search_field ) { |
| 66 | 66 | if ( $this->name === \GV\Utils::get( $search_field, 'key' ) ) { |
| 67 | - $search_field['choices'] = GravityView_Plugin_Hooks_Gravity_Flow::get_status_options(); |
|
| 67 | + $search_field[ 'choices' ] = GravityView_Plugin_Hooks_Gravity_Flow::get_status_options(); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | 28 | |
| 29 | - do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); |
|
| 29 | + do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); |
|
| 30 | 30 | |
| 31 | - do_action('gravityview_render_field_pickers', 'directory' ); |
|
| 31 | + do_action('gravityview_render_field_pickers', 'directory' ); |
|
| 32 | 32 | |
| 33 | - ?> |
|
| 33 | + ?> |
|
| 34 | 34 | |
| 35 | 35 | <?php // list of available widgets to be shown in the popup ?> |
| 36 | 36 | <div id="directory-available-widgets" class="hide-if-js gv-tooltip"> |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | <div id="single-active-fields" class="gv-grid gv-grid-pad gv-grid-border"> |
| 57 | 57 | <?php |
| 58 | - if(!empty( $curr_template ) ) { |
|
| 59 | - do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
| 60 | - } |
|
| 61 | - ?> |
|
| 58 | + if(!empty( $curr_template ) ) { |
|
| 59 | + do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
| 60 | + } |
|
| 61 | + ?> |
|
| 62 | 62 | </div> |
| 63 | 63 | <?php |
| 64 | - do_action('gravityview_render_field_pickers', 'single' ); |
|
| 64 | + do_action('gravityview_render_field_pickers', 'single' ); |
|
| 65 | 65 | ?> |
| 66 | 66 | </div> |
| 67 | 67 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | </div> |
| 81 | 81 | |
| 82 | 82 | <?php |
| 83 | - do_action('gravityview_render_field_pickers', 'edit' ); |
|
| 83 | + do_action('gravityview_render_field_pickers', 'edit' ); |
|
| 84 | 84 | ?> |
| 85 | 85 | |
| 86 | 86 | </div> |
@@ -10,32 +10,32 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | <div id="directory-fields" class="gv-section"> |
| 12 | 12 | |
| 13 | - <h4><?php esc_html_e( 'Above Entries Widgets', 'gravityview'); ?> <span><?php esc_html_e( 'These widgets will be shown above entries.', 'gravityview'); ?></span></h4> |
|
| 13 | + <h4><?php esc_html_e( 'Above Entries Widgets', 'gravityview' ); ?> <span><?php esc_html_e( 'These widgets will be shown above entries.', 'gravityview' ); ?></span></h4> |
|
| 14 | 14 | |
| 15 | - <?php do_action('gravityview_render_widgets_active_areas', $curr_template, 'header', $post->ID ); ?> |
|
| 15 | + <?php do_action( 'gravityview_render_widgets_active_areas', $curr_template, 'header', $post->ID ); ?> |
|
| 16 | 16 | |
| 17 | - <h4><?php esc_html_e( 'Entries Fields', 'gravityview'); ?> <span><?php esc_html_e( 'These fields will be shown for each entry.', 'gravityview'); ?></span></h4> |
|
| 17 | + <h4><?php esc_html_e( 'Entries Fields', 'gravityview' ); ?> <span><?php esc_html_e( 'These fields will be shown for each entry.', 'gravityview' ); ?></span></h4> |
|
| 18 | 18 | |
| 19 | 19 | <div id="directory-active-fields" class="gv-grid gv-grid-pad gv-grid-border"> |
| 20 | - <?php if(!empty( $curr_template ) ) { |
|
| 21 | - do_action('gravityview_render_directory_active_areas', $curr_template, 'directory', $post->ID, true ); |
|
| 20 | + <?php if ( ! empty( $curr_template ) ) { |
|
| 21 | + do_action( 'gravityview_render_directory_active_areas', $curr_template, 'directory', $post->ID, true ); |
|
| 22 | 22 | } ?> |
| 23 | 23 | </div> |
| 24 | 24 | |
| 25 | - <h4><?php esc_html_e( 'Below Entries Widgets', 'gravityview'); ?> <span><?php esc_html_e( 'These widgets will be shown below entries.', 'gravityview'); ?></span></h4> |
|
| 25 | + <h4><?php esc_html_e( 'Below Entries Widgets', 'gravityview' ); ?> <span><?php esc_html_e( 'These widgets will be shown below entries.', 'gravityview' ); ?></span></h4> |
|
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | 28 | |
| 29 | - do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); |
|
| 29 | + do_action( 'gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); |
|
| 30 | 30 | |
| 31 | - do_action('gravityview_render_field_pickers', 'directory' ); |
|
| 31 | + do_action( 'gravityview_render_field_pickers', 'directory' ); |
|
| 32 | 32 | |
| 33 | 33 | ?> |
| 34 | 34 | |
| 35 | 35 | <?php // list of available widgets to be shown in the popup ?> |
| 36 | 36 | <div id="directory-available-widgets" class="hide-if-js gv-tooltip"> |
| 37 | 37 | <span class="close"><i class="dashicons dashicons-dismiss"></i></span> |
| 38 | - <?php do_action('gravityview_render_available_widgets' ); ?> |
|
| 38 | + <?php do_action( 'gravityview_render_available_widgets' ); ?> |
|
| 39 | 39 | </div> |
| 40 | 40 | |
| 41 | 41 | </div> |
@@ -51,17 +51,17 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | <div id="single-fields" class="gv-section"> |
| 53 | 53 | |
| 54 | - <h4><?php esc_html_e( 'These fields will be shown in Single Entry view.', 'gravityview'); ?></h4> |
|
| 54 | + <h4><?php esc_html_e( 'These fields will be shown in Single Entry view.', 'gravityview' ); ?></h4> |
|
| 55 | 55 | |
| 56 | 56 | <div id="single-active-fields" class="gv-grid gv-grid-pad gv-grid-border"> |
| 57 | 57 | <?php |
| 58 | - if(!empty( $curr_template ) ) { |
|
| 59 | - do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
| 58 | + if ( ! empty( $curr_template ) ) { |
|
| 59 | + do_action( 'gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
| 60 | 60 | } |
| 61 | 61 | ?> |
| 62 | 62 | </div> |
| 63 | 63 | <?php |
| 64 | - do_action('gravityview_render_field_pickers', 'single' ); |
|
| 64 | + do_action( 'gravityview_render_field_pickers', 'single' ); |
|
| 65 | 65 | ?> |
| 66 | 66 | </div> |
| 67 | 67 | |
@@ -71,16 +71,16 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | <div id="edit-fields" class="gv-section"> |
| 73 | 73 | |
| 74 | - <h4><?php esc_html_e( 'Fields shown when editing an entry.', 'gravityview'); ?> <span><?php esc_html_e('If not configured, all form fields will be displayed.', 'gravityview'); ?></span></h4> |
|
| 74 | + <h4><?php esc_html_e( 'Fields shown when editing an entry.', 'gravityview' ); ?> <span><?php esc_html_e( 'If not configured, all form fields will be displayed.', 'gravityview' ); ?></span></h4> |
|
| 75 | 75 | |
| 76 | 76 | <div id="edit-active-fields" class="gv-grid gv-grid-pad gv-grid-border"> |
| 77 | 77 | <?php |
| 78 | - do_action('gravityview_render_directory_active_areas', apply_filters( 'gravityview/template/edit', 'default_table_edit' ), 'edit', $post->ID, true ); |
|
| 78 | + do_action( 'gravityview_render_directory_active_areas', apply_filters( 'gravityview/template/edit', 'default_table_edit' ), 'edit', $post->ID, true ); |
|
| 79 | 79 | ?> |
| 80 | 80 | </div> |
| 81 | 81 | |
| 82 | 82 | <?php |
| 83 | - do_action('gravityview_render_field_pickers', 'edit' ); |
|
| 83 | + do_action( 'gravityview_render_field_pickers', 'edit' ); |
|
| 84 | 84 | ?> |
| 85 | 85 | |
| 86 | 86 | </div> |