@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | 'author' => self::author, |
| 97 | 97 | 'language' => get_locale(), |
| 98 | 98 | 'url' => home_url(), |
| 99 | - 'beta' => $this->settings->get( 'beta' ), |
|
| 99 | + 'beta' => $this->settings->get( 'beta' ), |
|
| 100 | 100 | ); |
| 101 | 101 | |
| 102 | 102 | if ( ! empty( $action ) ) { |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | private function license_call_update_settings( $license_data, $data ) { |
| 464 | 464 | $settings = array(); |
| 465 | 465 | |
| 466 | - $settings['license_key'] = $license_data->license_key = trim( $data['license'] ); |
|
| 466 | + $settings['license_key'] = $license_data->license_key = trim( $data['license'] ); |
|
| 467 | 467 | $settings['license_key_status'] = $license_data->license; |
| 468 | 468 | $settings['license_key_response'] = (array)$license_data; |
| 469 | 469 | |
@@ -597,14 +597,14 @@ discard block |
||
| 597 | 597 | // Call the custom API. |
| 598 | 598 | $response = wp_remote_post( self::url, array( |
| 599 | 599 | 'timeout' => 15, |
| 600 | - 'sslverify' => false, |
|
| 601 | - 'body' => array( |
|
| 602 | - 'edd_action' => 'check_license', |
|
| 603 | - 'license' => trim( $this->settings->get( 'license_key' ) ), |
|
| 604 | - 'item_name' => self::name, |
|
| 605 | - 'url' => home_url(), |
|
| 606 | - 'site_data' => $this->get_site_data(), |
|
| 607 | - ), |
|
| 600 | + 'sslverify' => false, |
|
| 601 | + 'body' => array( |
|
| 602 | + 'edd_action' => 'check_license', |
|
| 603 | + 'license' => trim( $this->settings->get( 'license_key' ) ), |
|
| 604 | + 'item_name' => self::name, |
|
| 605 | + 'url' => home_url(), |
|
| 606 | + 'site_data' => $this->get_site_data(), |
|
| 607 | + ), |
|
| 608 | 608 | )); |
| 609 | 609 | |
| 610 | 610 | // make sure the response came back okay |
@@ -237,26 +237,26 @@ |
||
| 237 | 237 | |
| 238 | 238 | /** DEBUG */ |
| 239 | 239 | |
| 240 | - /** |
|
| 241 | - * Logs messages using Gravity Forms logging add-on |
|
| 242 | - * @param string $message log message |
|
| 243 | - * @param mixed $data Additional data to display |
|
| 240 | + /** |
|
| 241 | + * Logs messages using Gravity Forms logging add-on |
|
| 242 | + * @param string $message log message |
|
| 243 | + * @param mixed $data Additional data to display |
|
| 244 | 244 | * @deprecated use gravityview()->log |
| 245 | - * @return void |
|
| 246 | - */ |
|
| 247 | - public static function log_debug( $message, $data = null ){ |
|
| 245 | + * @return void |
|
| 246 | + */ |
|
| 247 | + public static function log_debug( $message, $data = null ){ |
|
| 248 | 248 | gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' ); |
| 249 | 249 | gravityview()->log->debug( $message, $data ); |
| 250 | - } |
|
| 250 | + } |
|
| 251 | 251 | |
| 252 | - /** |
|
| 253 | - * Logs messages using Gravity Forms logging add-on |
|
| 254 | - * @param string $message log message |
|
| 252 | + /** |
|
| 253 | + * Logs messages using Gravity Forms logging add-on |
|
| 254 | + * @param string $message log message |
|
| 255 | 255 | * @deprecated use gravityview()->log |
| 256 | - * @return void |
|
| 257 | - */ |
|
| 258 | - public static function log_error( $message, $data = null ){ |
|
| 256 | + * @return void |
|
| 257 | + */ |
|
| 258 | + public static function log_error( $message, $data = null ){ |
|
| 259 | 259 | gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' ); |
| 260 | 260 | gravityview()->log->error( $message, $data ); |
| 261 | - } |
|
| 261 | + } |
|
| 262 | 262 | } // end class GravityView_Plugin |
@@ -161,20 +161,20 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | if( !empty( $field['custom_class'] ) ) { |
| 163 | 163 | |
| 164 | - $custom_class = $field['custom_class']; |
|
| 164 | + $custom_class = $field['custom_class']; |
|
| 165 | 165 | |
| 166 | - if( !empty( $entry ) ) { |
|
| 166 | + if( !empty( $entry ) ) { |
|
| 167 | 167 | |
| 168 | - // We want the merge tag to be formatted as a class. The merge tag may be |
|
| 169 | - // replaced by a multiple-word value that should be output as a single class. |
|
| 170 | - // "Office Manager" will be formatted as `.OfficeManager`, not `.Office` and `.Manager` |
|
| 171 | - add_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 168 | + // We want the merge tag to be formatted as a class. The merge tag may be |
|
| 169 | + // replaced by a multiple-word value that should be output as a single class. |
|
| 170 | + // "Office Manager" will be formatted as `.OfficeManager`, not `.Office` and `.Manager` |
|
| 171 | + add_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 172 | 172 | |
| 173 | - $custom_class = self::replace_variables( $custom_class, $form, $entry); |
|
| 173 | + $custom_class = self::replace_variables( $custom_class, $form, $entry); |
|
| 174 | 174 | |
| 175 | - // And then we want life to return to normal |
|
| 176 | - remove_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 177 | - } |
|
| 175 | + // And then we want life to return to normal |
|
| 176 | + remove_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 177 | + } |
|
| 178 | 178 | |
| 179 | 179 | // And now we want the spaces to be handled nicely. |
| 180 | 180 | $classes[] = gravityview_sanitize_html_class( $custom_class ); |
@@ -531,32 +531,32 @@ discard block |
||
| 531 | 531 | return sanitize_title( $slug ); |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | - /** |
|
| 535 | - * If using the entry custom slug feature, make sure the new entries have the custom slug created and saved as meta |
|
| 536 | - * |
|
| 537 | - * Triggered by add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 ); |
|
| 538 | - * |
|
| 539 | - * @param $entry array Gravity Forms entry object |
|
| 540 | - * @param $form array Gravity Forms form object |
|
| 541 | - */ |
|
| 542 | - public static function entry_create_custom_slug( $entry, $form ) { |
|
| 543 | - /** |
|
| 544 | - * @filter `gravityview_custom_entry_slug` On entry creation, check if we are using the custom entry slug feature and update the meta |
|
| 545 | - * @param boolean $custom Should we process the custom entry slug? |
|
| 546 | - */ |
|
| 547 | - $custom = apply_filters( 'gravityview_custom_entry_slug', false ); |
|
| 548 | - if( $custom ) { |
|
| 549 | - // create the gravityview_unique_id and save it |
|
| 534 | + /** |
|
| 535 | + * If using the entry custom slug feature, make sure the new entries have the custom slug created and saved as meta |
|
| 536 | + * |
|
| 537 | + * Triggered by add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 ); |
|
| 538 | + * |
|
| 539 | + * @param $entry array Gravity Forms entry object |
|
| 540 | + * @param $form array Gravity Forms form object |
|
| 541 | + */ |
|
| 542 | + public static function entry_create_custom_slug( $entry, $form ) { |
|
| 543 | + /** |
|
| 544 | + * @filter `gravityview_custom_entry_slug` On entry creation, check if we are using the custom entry slug feature and update the meta |
|
| 545 | + * @param boolean $custom Should we process the custom entry slug? |
|
| 546 | + */ |
|
| 547 | + $custom = apply_filters( 'gravityview_custom_entry_slug', false ); |
|
| 548 | + if( $custom ) { |
|
| 549 | + // create the gravityview_unique_id and save it |
|
| 550 | 550 | |
| 551 | - // Get the entry hash |
|
| 552 | - $hash = self::get_custom_entry_slug( $entry['id'], $entry ); |
|
| 551 | + // Get the entry hash |
|
| 552 | + $hash = self::get_custom_entry_slug( $entry['id'], $entry ); |
|
| 553 | 553 | |
| 554 | - gravityview()->log->debug( 'Setting hash for entry {entry_id}: {hash}', array( 'entry_id' => $entry['id'], 'hash' => $hash ) ); |
|
| 554 | + gravityview()->log->debug( 'Setting hash for entry {entry_id}: {hash}', array( 'entry_id' => $entry['id'], 'hash' => $hash ) ); |
|
| 555 | 555 | |
| 556 | - gform_update_meta( $entry['id'], 'gravityview_unique_id', $hash, \GV\Utils::get( $entry, 'form_id' ) ); |
|
| 556 | + gform_update_meta( $entry['id'], 'gravityview_unique_id', $hash, \GV\Utils::get( $entry, 'form_id' ) ); |
|
| 557 | 557 | |
| 558 | - } |
|
| 559 | - } |
|
| 558 | + } |
|
| 559 | + } |
|
| 560 | 560 | |
| 561 | 561 | |
| 562 | 562 | |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | |
| 900 | 900 | // If there was an error, continue to the next term. |
| 901 | 901 | if ( is_wp_error( $term_link ) ) { |
| 902 | - continue; |
|
| 902 | + continue; |
|
| 903 | 903 | } |
| 904 | 904 | |
| 905 | 905 | $output[] = gravityview_get_link( $term_link, esc_html( $term->name ) ); |
@@ -48,132 +48,132 @@ |
||
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * Given information provided in an entry, get array of media IDs |
|
| 52 | - * |
|
| 53 | - * This is necessary because GF doesn't expect to need to update post images, only to create them. |
|
| 54 | - * |
|
| 55 | - * @see GFFormsModel::create_post() |
|
| 56 | - * |
|
| 57 | - * @since 1.17 |
|
| 58 | - * |
|
| 59 | - * @param array $form Gravity Forms form array |
|
| 60 | - * @param array $entry Gravity Forms entry array |
|
| 61 | - * |
|
| 62 | - * @return array Array of "Field ID" => "Media IDs" |
|
| 63 | - */ |
|
| 64 | - public static function get_post_field_images( $form, $entry ) { |
|
| 65 | - |
|
| 66 | - $post_data = self::get_post_fields( $form, $entry ); |
|
| 67 | - |
|
| 68 | - $media = get_attached_media( 'image', $entry['post_id'] ); |
|
| 69 | - |
|
| 70 | - $post_images = array(); |
|
| 71 | - |
|
| 72 | - foreach ( $media as $media_item ) { |
|
| 73 | - foreach( (array) $post_data['images'] as $post_data_item ) { |
|
| 74 | - if( |
|
| 75 | - \GV\Utils::get( $post_data_item, 'title' ) === $media_item->post_title && |
|
| 76 | - \GV\Utils::get( $post_data_item, 'description' ) === $media_item->post_content && |
|
| 77 | - \GV\Utils::get( $post_data_item, 'caption' ) === $media_item->post_excerpt |
|
| 78 | - ) { |
|
| 79 | - $post_images["{$post_data_item['field_id']}"] = $media_item->ID; |
|
| 80 | - } |
|
| 81 | - } |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - return $post_images; |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * Alias of GFFormsModel::get_post_fields(); just making it public |
|
| 89 | - * |
|
| 90 | - * @see GFFormsModel::get_post_fields() |
|
| 91 | - * |
|
| 92 | - * @since 1.17 |
|
| 93 | - * |
|
| 94 | - * @param array $form Gravity Forms form array |
|
| 95 | - * @param array $entry Gravity Forms entry array |
|
| 96 | - * |
|
| 97 | - * @return array |
|
| 98 | - */ |
|
| 99 | - public static function get_post_fields( $form, $entry ) { |
|
| 100 | - |
|
| 101 | - $reflection = new ReflectionMethod( 'GFFormsModel', 'get_post_fields' ); |
|
| 102 | - |
|
| 103 | - /** |
|
| 104 | - * If the method changes to public, use Gravity Forms' method |
|
| 105 | - * @todo: If/when the method is public, remove the unneeded copied code. |
|
| 106 | - */ |
|
| 107 | - if( $reflection->isPublic() ) { |
|
| 108 | - return parent::get_post_fields( $form, $entry ); |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - // It was private; let's make it public |
|
| 112 | - $reflection->setAccessible( true ); |
|
| 113 | - |
|
| 114 | - return $reflection->invoke( new GFFormsModel, $form, $entry ); |
|
| 115 | - } |
|
| 116 | - |
|
| 117 | - /** |
|
| 118 | - * Copied function from Gravity Forms plugin \GFFormsModel::copy_post_image since the method is private. |
|
| 119 | - * |
|
| 120 | - * @since 1.16.2 |
|
| 121 | - * |
|
| 122 | - * @param string $url URL of the post image to update |
|
| 123 | - * @param int $post_id ID of the post image to update |
|
| 124 | - * @return array|bool Array with `file`, `url` and `type` keys. False: failed to copy file to final directory path. |
|
| 125 | - */ |
|
| 126 | - public static function copy_post_image( $url, $post_id ) { |
|
| 127 | - |
|
| 128 | - $reflection = new ReflectionMethod( 'GFFormsModel', 'copy_post_image' ); |
|
| 129 | - |
|
| 130 | - /** |
|
| 131 | - * If the method changes to public, use Gravity Forms' method |
|
| 132 | - * @todo: If/when the method is public, remove the unneeded copied code. |
|
| 133 | - */ |
|
| 134 | - if( $reflection->isPublic() ) { |
|
| 135 | - return parent::copy_post_image( $url, $post_id ); |
|
| 136 | - } |
|
| 137 | - |
|
| 138 | - // It was private; let's make it public |
|
| 139 | - $reflection->setAccessible( true ); |
|
| 140 | - |
|
| 141 | - return $reflection->invoke( new GFFormsModel, $url, $post_id ); |
|
| 142 | - } |
|
| 143 | - |
|
| 144 | - /** |
|
| 145 | - * Copied function from Gravity Forms plugin \GFFormsModel::media_handle_upload since the method is private. |
|
| 146 | - * |
|
| 147 | - * Note: The method became public in GF 1.9.17.7 |
|
| 148 | - * |
|
| 149 | - * @see GFFormsModel::media_handle_upload |
|
| 150 | - * @see GravityView_Edit_Entry_Render::maybe_update_post_fields |
|
| 151 | - * |
|
| 152 | - * @uses copy_post_image |
|
| 153 | - * @uses wp_insert_attachment |
|
| 154 | - * @uses wp_update_attachment_metadata |
|
| 155 | - * |
|
| 156 | - * @param string $url URL of the post image to update |
|
| 157 | - * @param int $post_id ID of the post image to update |
|
| 158 | - * @param array $post_data Array of data for the eventual attachment post type that is created using {@see wp_insert_attachment}. Supports `post_mime_type`, `guid`, `post_parent`, `post_title`, `post_content` keys. |
|
| 159 | - * @return bool|int ID of attachment Post created. Returns false if file not created by copy_post_image |
|
| 160 | - */ |
|
| 161 | - public static function media_handle_upload( $url, $post_id, $post_data = array() ) { |
|
| 162 | - |
|
| 163 | - $reflection = new ReflectionMethod( 'GFFormsModel', 'media_handle_upload' ); |
|
| 164 | - |
|
| 165 | - /** |
|
| 166 | - * If the method changes to public, use Gravity Forms' method |
|
| 167 | - * @todo: If/when the method is public, remove the unneeded copied code. |
|
| 168 | - */ |
|
| 169 | - if( $reflection->isPublic() ) { |
|
| 170 | - return parent::media_handle_upload( $url, $post_id, $post_data ); |
|
| 171 | - } |
|
| 172 | - |
|
| 173 | - // It was private; let's make it public |
|
| 174 | - $reflection->setAccessible( true ); |
|
| 175 | - |
|
| 176 | - return $reflection->invoke( new GFFormsModel, $url, $post_id, $post_data ); |
|
| 177 | - } |
|
| 51 | + * Given information provided in an entry, get array of media IDs |
|
| 52 | + * |
|
| 53 | + * This is necessary because GF doesn't expect to need to update post images, only to create them. |
|
| 54 | + * |
|
| 55 | + * @see GFFormsModel::create_post() |
|
| 56 | + * |
|
| 57 | + * @since 1.17 |
|
| 58 | + * |
|
| 59 | + * @param array $form Gravity Forms form array |
|
| 60 | + * @param array $entry Gravity Forms entry array |
|
| 61 | + * |
|
| 62 | + * @return array Array of "Field ID" => "Media IDs" |
|
| 63 | + */ |
|
| 64 | + public static function get_post_field_images( $form, $entry ) { |
|
| 65 | + |
|
| 66 | + $post_data = self::get_post_fields( $form, $entry ); |
|
| 67 | + |
|
| 68 | + $media = get_attached_media( 'image', $entry['post_id'] ); |
|
| 69 | + |
|
| 70 | + $post_images = array(); |
|
| 71 | + |
|
| 72 | + foreach ( $media as $media_item ) { |
|
| 73 | + foreach( (array) $post_data['images'] as $post_data_item ) { |
|
| 74 | + if( |
|
| 75 | + \GV\Utils::get( $post_data_item, 'title' ) === $media_item->post_title && |
|
| 76 | + \GV\Utils::get( $post_data_item, 'description' ) === $media_item->post_content && |
|
| 77 | + \GV\Utils::get( $post_data_item, 'caption' ) === $media_item->post_excerpt |
|
| 78 | + ) { |
|
| 79 | + $post_images["{$post_data_item['field_id']}"] = $media_item->ID; |
|
| 80 | + } |
|
| 81 | + } |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + return $post_images; |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * Alias of GFFormsModel::get_post_fields(); just making it public |
|
| 89 | + * |
|
| 90 | + * @see GFFormsModel::get_post_fields() |
|
| 91 | + * |
|
| 92 | + * @since 1.17 |
|
| 93 | + * |
|
| 94 | + * @param array $form Gravity Forms form array |
|
| 95 | + * @param array $entry Gravity Forms entry array |
|
| 96 | + * |
|
| 97 | + * @return array |
|
| 98 | + */ |
|
| 99 | + public static function get_post_fields( $form, $entry ) { |
|
| 100 | + |
|
| 101 | + $reflection = new ReflectionMethod( 'GFFormsModel', 'get_post_fields' ); |
|
| 102 | + |
|
| 103 | + /** |
|
| 104 | + * If the method changes to public, use Gravity Forms' method |
|
| 105 | + * @todo: If/when the method is public, remove the unneeded copied code. |
|
| 106 | + */ |
|
| 107 | + if( $reflection->isPublic() ) { |
|
| 108 | + return parent::get_post_fields( $form, $entry ); |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + // It was private; let's make it public |
|
| 112 | + $reflection->setAccessible( true ); |
|
| 113 | + |
|
| 114 | + return $reflection->invoke( new GFFormsModel, $form, $entry ); |
|
| 115 | + } |
|
| 116 | + |
|
| 117 | + /** |
|
| 118 | + * Copied function from Gravity Forms plugin \GFFormsModel::copy_post_image since the method is private. |
|
| 119 | + * |
|
| 120 | + * @since 1.16.2 |
|
| 121 | + * |
|
| 122 | + * @param string $url URL of the post image to update |
|
| 123 | + * @param int $post_id ID of the post image to update |
|
| 124 | + * @return array|bool Array with `file`, `url` and `type` keys. False: failed to copy file to final directory path. |
|
| 125 | + */ |
|
| 126 | + public static function copy_post_image( $url, $post_id ) { |
|
| 127 | + |
|
| 128 | + $reflection = new ReflectionMethod( 'GFFormsModel', 'copy_post_image' ); |
|
| 129 | + |
|
| 130 | + /** |
|
| 131 | + * If the method changes to public, use Gravity Forms' method |
|
| 132 | + * @todo: If/when the method is public, remove the unneeded copied code. |
|
| 133 | + */ |
|
| 134 | + if( $reflection->isPublic() ) { |
|
| 135 | + return parent::copy_post_image( $url, $post_id ); |
|
| 136 | + } |
|
| 137 | + |
|
| 138 | + // It was private; let's make it public |
|
| 139 | + $reflection->setAccessible( true ); |
|
| 140 | + |
|
| 141 | + return $reflection->invoke( new GFFormsModel, $url, $post_id ); |
|
| 142 | + } |
|
| 143 | + |
|
| 144 | + /** |
|
| 145 | + * Copied function from Gravity Forms plugin \GFFormsModel::media_handle_upload since the method is private. |
|
| 146 | + * |
|
| 147 | + * Note: The method became public in GF 1.9.17.7 |
|
| 148 | + * |
|
| 149 | + * @see GFFormsModel::media_handle_upload |
|
| 150 | + * @see GravityView_Edit_Entry_Render::maybe_update_post_fields |
|
| 151 | + * |
|
| 152 | + * @uses copy_post_image |
|
| 153 | + * @uses wp_insert_attachment |
|
| 154 | + * @uses wp_update_attachment_metadata |
|
| 155 | + * |
|
| 156 | + * @param string $url URL of the post image to update |
|
| 157 | + * @param int $post_id ID of the post image to update |
|
| 158 | + * @param array $post_data Array of data for the eventual attachment post type that is created using {@see wp_insert_attachment}. Supports `post_mime_type`, `guid`, `post_parent`, `post_title`, `post_content` keys. |
|
| 159 | + * @return bool|int ID of attachment Post created. Returns false if file not created by copy_post_image |
|
| 160 | + */ |
|
| 161 | + public static function media_handle_upload( $url, $post_id, $post_data = array() ) { |
|
| 162 | + |
|
| 163 | + $reflection = new ReflectionMethod( 'GFFormsModel', 'media_handle_upload' ); |
|
| 164 | + |
|
| 165 | + /** |
|
| 166 | + * If the method changes to public, use Gravity Forms' method |
|
| 167 | + * @todo: If/when the method is public, remove the unneeded copied code. |
|
| 168 | + */ |
|
| 169 | + if( $reflection->isPublic() ) { |
|
| 170 | + return parent::media_handle_upload( $url, $post_id, $post_data ); |
|
| 171 | + } |
|
| 172 | + |
|
| 173 | + // It was private; let's make it public |
|
| 174 | + $reflection->setAccessible( true ); |
|
| 175 | + |
|
| 176 | + return $reflection->invoke( new GFFormsModel, $url, $post_id, $post_data ); |
|
| 177 | + } |
|
| 178 | 178 | |
| 179 | 179 | } |
| 180 | 180 | \ No newline at end of file |
@@ -41,22 +41,22 @@ |
||
| 41 | 41 | |
| 42 | 42 | <?php |
| 43 | 43 | |
| 44 | - $search_value = \GV\Utils::_GET( $search_field['name'] ); |
|
| 44 | + $search_value = \GV\Utils::_GET( $search_field['name'] ); |
|
| 45 | 45 | |
| 46 | - foreach ( $search_field['choices'] as $k => $choice ) { |
|
| 46 | + foreach ( $search_field['choices'] as $k => $choice ) { |
|
| 47 | 47 | |
| 48 | - if ( 0 != $k ) { |
|
| 49 | - echo esc_html( $links_sep ); |
|
| 50 | - } |
|
| 48 | + if ( 0 != $k ) { |
|
| 49 | + echo esc_html( $links_sep ); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - $active = ( '' !== $search_value && in_array( $search_value, array( $choice['text'], $choice['value'] ) ) ) ? ' class="active"' : false; |
|
| 52 | + $active = ( '' !== $search_value && in_array( $search_value, array( $choice['text'], $choice['value'] ) ) ) ? ' class="active"' : false; |
|
| 53 | 53 | |
| 54 | - if ( $active ) { |
|
| 55 | - $link = remove_query_arg( array( 'pagenum', $search_field['name'] ), $base_url ); |
|
| 56 | - } else { |
|
| 57 | - $link = add_query_arg( array( $search_field['name'] => urlencode( $choice['value'] ) ), remove_query_arg( array('pagenum'), $base_url ) ); |
|
| 58 | - } |
|
| 59 | - ?> |
|
| 54 | + if ( $active ) { |
|
| 55 | + $link = remove_query_arg( array( 'pagenum', $search_field['name'] ), $base_url ); |
|
| 56 | + } else { |
|
| 57 | + $link = add_query_arg( array( $search_field['name'] => urlencode( $choice['value'] ) ), remove_query_arg( array('pagenum'), $base_url ) ); |
|
| 58 | + } |
|
| 59 | + ?> |
|
| 60 | 60 | |
| 61 | 61 | <a href="<?php echo esc_url_raw( $link ); ?>" <?php echo $active; ?>><?php echo esc_html( $choice['text'] ); ?></a> |
| 62 | 62 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * @action `gravityview_search_widget_field_before` Before each search input is rendered (other than the submit button) |
| 33 | 33 | * @param GravityView_Widget_Search $this GravityView Widget instance |
| 34 | - * @param array $search_field |
|
| 34 | + * @param array $search_field |
|
| 35 | 35 | */ |
| 36 | 36 | do_action( 'gravityview_search_widget_field_before', $this, $search_field ); |
| 37 | 37 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | /** |
| 47 | 47 | * @action `gravityview_search_widget_field_after` After each search input is rendered (other than the submit button) |
| 48 | 48 | * @param GravityView_Widget_Search $this GravityView Widget instance |
| 49 | - * @param array $search_field |
|
| 49 | + * @param array $search_field |
|
| 50 | 50 | */ |
| 51 | 51 | do_action( 'gravityview_search_widget_field_after', $this, $search_field ); |
| 52 | 52 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | do_action( 'gravityview_search_widget_fields_after', $this ); |
| 59 | 59 | |
| 60 | 60 | if( $has_inputs ) { |
| 61 | - $this->render( 'search-field', 'submit', false ); |
|
| 62 | - } |
|
| 61 | + $this->render( 'search-field', 'submit', false ); |
|
| 62 | + } |
|
| 63 | 63 | ?> |
| 64 | 64 | </form> |
@@ -28,13 +28,13 @@ |
||
| 28 | 28 | |
| 29 | 29 | $show_mt = $this->show_merge_tags(); |
| 30 | 30 | |
| 31 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 32 | - $class .= ' merge-tag-support mt-position-right '; |
|
| 31 | + if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 32 | + $class .= ' merge-tag-support mt-position-right '; |
|
| 33 | 33 | |
| 34 | - if( empty( $this->field['show_all_fields'] ) ) { |
|
| 35 | - $class .= ' mt-hide_all_fields '; |
|
| 36 | - } |
|
| 37 | - } |
|
| 34 | + if( empty( $this->field['show_all_fields'] ) ) { |
|
| 35 | + $class .= ' mt-hide_all_fields '; |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | 38 | $class .= \GV\Utils::get( $this->field, 'class' ); |
| 39 | 39 | $placeholder = \GV\Utils::get( $this->field, 'placeholder' ); |
| 40 | 40 | $rows = \GV\Utils::get( $this->field, 'rows', 5 ); |
@@ -28,11 +28,11 @@ |
||
| 28 | 28 | |
| 29 | 29 | $show_mt = $this->show_merge_tags(); |
| 30 | 30 | |
| 31 | - if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 32 | - $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
|
| 33 | - } |
|
| 34 | - $class .= \GV\Utils::get( $this->field, 'class', 'widefat' ); |
|
| 35 | - $placeholder = \GV\Utils::get( $this->field, 'placeholder' ); |
|
| 31 | + if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) { |
|
| 32 | + $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
|
| 33 | + } |
|
| 34 | + $class .= \GV\Utils::get( $this->field, 'class', 'widefat' ); |
|
| 35 | + $placeholder = \GV\Utils::get( $this->field, 'placeholder' ); |
|
| 36 | 36 | ?> |
| 37 | 37 | <input name="<?php echo esc_attr( $this->name ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>"> |
| 38 | 38 | <?php |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | self::getInstance()->set_entry( $entry ); |
| 241 | 241 | |
| 242 | - $base = GravityView_API::directory_link( $post_id ? : $view_id, true ); |
|
| 242 | + $base = GravityView_API::directory_link( $post_id ? : $view_id, true ); |
|
| 243 | 243 | |
| 244 | 244 | if ( empty( $base ) ) { |
| 245 | 245 | gravityview()->log->error( 'Post ID does not exist: {post_id}', array( 'post_id' => $post_id ) ); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | 'action' => 'delete', |
| 254 | 254 | 'entry_id' => $entry_slug, |
| 255 | 255 | 'gvid' => $view_id, |
| 256 | - 'view_id' => $view_id, |
|
| 256 | + 'view_id' => $view_id, |
|
| 257 | 257 | ), $base ); |
| 258 | 258 | |
| 259 | 259 | $url = wp_nonce_url( $actionurl, 'delete_'.$entry_slug, 'delete' ); |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | * @since 1.16.4 |
| 428 | 428 | * @param int $entry_id ID of the Gravity Forms entry |
| 429 | 429 | * @param array $entry Deleted entry array |
| 430 | - */ |
|
| 430 | + */ |
|
| 431 | 431 | do_action( 'gravityview/delete-entry/deleted', $entry_id, $entry ); |
| 432 | 432 | } |
| 433 | 433 | |