@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
| 49 | 49 | |
| 50 | - if( 'edit' === $context ) { |
|
| 50 | + if ( 'edit' === $context ) { |
|
| 51 | 51 | return $field_options; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $this->add_field_support('date_display', $field_options ); |
|
| 54 | + $this->add_field_support( 'date_display', $field_options ); |
|
| 55 | 55 | |
| 56 | 56 | return $field_options; |
| 57 | 57 | } |
@@ -71,11 +71,11 @@ discard block |
||
| 71 | 71 | public function get_content( $output = '', $entry = array(), $field_settings = array(), $field = array() ) { |
| 72 | 72 | |
| 73 | 73 | /** Overridden by a template. */ |
| 74 | - if( \GV\Utils::get( $field, 'field_path' ) !== gravityview()->plugin->dir( 'templates/fields/field-html.php' ) ) { |
|
| 74 | + if ( \GV\Utils::get( $field, 'field_path' ) !== gravityview()->plugin->dir( 'templates/fields/field-html.php' ) ) { |
|
| 75 | 75 | return $output; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - return GVCommon::format_date( $field['value'], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) ); |
|
| 78 | + return GVCommon::format_date( $field[ 'value' ], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) ); |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | parent::add_hooks(); |
| 35 | 35 | |
| 36 | - add_filter( 'gravityview/search/searchable_fields', array( $this, 'modify_search_bar_fields_dropdown'), 10, 2 ); |
|
| 36 | + add_filter( 'gravityview/search/searchable_fields', array( $this, 'modify_search_bar_fields_dropdown' ), 10, 2 ); |
|
| 37 | 37 | |
| 38 | 38 | add_filter( 'gravityview/admin/available_fields', array( $this, 'maybe_add_non_default_fields' ), 10, 3 ); |
| 39 | 39 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @return void |
| 54 | 54 | */ |
| 55 | 55 | public function clear_cache_after_workflow( $form, $entry_id, $step_id, $starting_step_id ) { |
| 56 | - do_action( 'gravityview_clear_form_cache', $form['id'] ); |
|
| 56 | + do_action( 'gravityview_clear_form_cache', $form[ 'id' ] ); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public static function get_status_options( $form_id = 0, $status_key = 'workflow_final_status' ) { |
| 72 | 72 | |
| 73 | - if( empty( $form_id ) ) { |
|
| 73 | + if ( empty( $form_id ) ) { |
|
| 74 | 74 | $form_id = GravityView_View::getInstance()->getFormId(); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $entry_meta = gravity_flow()->get_entry_meta( array(), $form_id ); |
| 78 | 78 | |
| 79 | - return (array) \GV\Utils::get( $entry_meta, $status_key . '/filter/choices' ); |
|
| 79 | + return (array)\GV\Utils::get( $entry_meta, $status_key . '/filter/choices' ); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | $workflow_steps = $GFlow->get_steps(); |
| 100 | 100 | |
| 101 | - if( $workflow_steps ) { |
|
| 101 | + if ( $workflow_steps ) { |
|
| 102 | 102 | |
| 103 | 103 | foreach ( $workflow_steps as $step ) { |
| 104 | 104 | |
@@ -110,12 +110,12 @@ discard block |
||
| 110 | 110 | ); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - $fields['workflow_step'] = array( |
|
| 113 | + $fields[ 'workflow_step' ] = array( |
|
| 114 | 114 | 'label' => esc_html__( 'Workflow Step', 'gravityview' ), |
| 115 | 115 | 'type' => 'select', |
| 116 | 116 | ); |
| 117 | 117 | |
| 118 | - $fields['workflow_final_status'] = array( |
|
| 118 | + $fields[ 'workflow_final_status' ] = array( |
|
| 119 | 119 | 'label' => esc_html__( 'Workflow Status', 'gravityview' ), |
| 120 | 120 | 'type' => 'select', |
| 121 | 121 | ); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if ( ( $insert_at = array_search( 'workflow_final_status', wp_list_pluck( $fields, 'key' ) ) ) !== false ) { |
| 132 | 132 | $fields_end = array_splice( $fields, $insert_at + 1 ); |
| 133 | 133 | |
| 134 | - $fields[] = array( |
|
| 134 | + $fields[ ] = array( |
|
| 135 | 135 | 'text' => __( 'Workflow Current Status Timestamp', 'gravityview' ), |
| 136 | 136 | 'operators' => array( '>', '<' ), |
| 137 | 137 | 'placeholder' => 'yyyy-mm-dd', |
@@ -157,8 +157,8 @@ discard block |
||
| 157 | 157 | $keys_end = array_splice( $keys, $insert_at + 1 ); |
| 158 | 158 | $values_end = array_splice( $values, $insert_at + 1 ); |
| 159 | 159 | |
| 160 | - $keys[] = 'workflow_current_status_timestamp'; |
|
| 161 | - $values[] = array( |
|
| 160 | + $keys[ ] = 'workflow_current_status_timestamp'; |
|
| 161 | + $values[ ] = array( |
|
| 162 | 162 | 'label' => __( 'Workflow Current Status Timestamp', 'gravityview' ), |
| 163 | 163 | 'type' => 'workflow_current_status_timestamp', |
| 164 | 164 | ); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function set_provider( $provider = null ) { |
| 40 | 40 | |
| 41 | - if( gravityview()->request->is_admin() ) { |
|
| 41 | + if ( gravityview()->request->is_admin() ) { |
|
| 42 | 42 | return; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // We're switching providers; remove the hooks that were added. |
| 60 | - if( self::$active_provider ) { |
|
| 60 | + if ( self::$active_provider ) { |
|
| 61 | 61 | self::$active_provider->remove_hooks(); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -10,7 +10,9 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly |
| 13 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 13 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 14 | + exit; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | /** |
| 16 | 18 | * Allows plugins to use their own update API. |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | $this->api_data = $_api_data; |
| 49 | 49 | $this->name = plugin_basename( $_plugin_file ); |
| 50 | 50 | $this->slug = basename( $_plugin_file, '.php' ); |
| 51 | - $this->version = $_api_data['version']; |
|
| 52 | - $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false; |
|
| 53 | - $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; |
|
| 54 | - $this->cache_key = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ); |
|
| 51 | + $this->version = $_api_data[ 'version' ]; |
|
| 52 | + $this->wp_override = isset( $_api_data[ 'wp_override' ] ) ? (bool)$_api_data[ 'wp_override' ] : false; |
|
| 53 | + $this->beta = ! empty( $this->api_data[ 'beta' ] ) ? true : false; |
|
| 54 | + $this->cache_key = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data[ 'license' ] . $this->beta ) ); |
|
| 55 | 55 | |
| 56 | 56 | $edd_plugin_data[ $this->slug ] = $this->api_data; |
| 57 | 57 | |
@@ -173,11 +173,11 @@ discard block |
||
| 173 | 173 | return; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - if( ! current_user_can( 'update_plugins' ) ) { |
|
| 176 | + if ( ! current_user_can( 'update_plugins' ) ) { |
|
| 177 | 177 | return; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - if( ! is_multisite() ) { |
|
| 180 | + if ( ! is_multisite() ) { |
|
| 181 | 181 | return; |
| 182 | 182 | } |
| 183 | 183 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">', |
| 270 | 270 | esc_html( $version_info->new_version ), |
| 271 | 271 | '</a>', |
| 272 | - '<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">', |
|
| 272 | + '<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) . '">', |
|
| 273 | 273 | '</a>' |
| 274 | 274 | ); |
| 275 | 275 | } |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | $_data->contributors = $this->convert_object_to_array( $_data->contributors ); |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | - if( ! isset( $_data->plugin ) ) { |
|
| 356 | + if ( ! isset( $_data->plugin ) ) { |
|
| 357 | 357 | $_data->plugin = $this->name; |
| 358 | 358 | } |
| 359 | 359 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | $verify_ssl = $this->verify_ssl(); |
| 397 | 397 | if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) { |
| 398 | - $args['sslverify'] = $verify_ssl; |
|
| 398 | + $args[ 'sslverify' ] = $verify_ssl; |
|
| 399 | 399 | } |
| 400 | 400 | return $args; |
| 401 | 401 | |
@@ -423,9 +423,9 @@ discard block |
||
| 423 | 423 | if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) { |
| 424 | 424 | $test_url_parts = parse_url( $this->api_url ); |
| 425 | 425 | |
| 426 | - $scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme'] : 'http'; |
|
| 427 | - $host = ! empty( $test_url_parts['host'] ) ? $test_url_parts['host'] : ''; |
|
| 428 | - $port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : ''; |
|
| 426 | + $scheme = ! empty( $test_url_parts[ 'scheme' ] ) ? $test_url_parts[ 'scheme' ] : 'http'; |
|
| 427 | + $host = ! empty( $test_url_parts[ 'host' ] ) ? $test_url_parts[ 'host' ] : ''; |
|
| 428 | + $port = ! empty( $test_url_parts[ 'port' ] ) ? ':' . $test_url_parts[ 'port' ] : ''; |
|
| 429 | 429 | |
| 430 | 430 | if ( empty( $host ) ) { |
| 431 | 431 | $edd_plugin_url_available[ $store_hash ] = false; |
@@ -442,27 +442,27 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | $data = array_merge( $this->api_data, $_data ); |
| 444 | 444 | |
| 445 | - if ( $data['slug'] != $this->slug ) { |
|
| 445 | + if ( $data[ 'slug' ] != $this->slug ) { |
|
| 446 | 446 | return false; |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | - if ( $this->api_url == trailingslashit ( home_url() ) ) { |
|
| 449 | + if ( $this->api_url == trailingslashit( home_url() ) ) { |
|
| 450 | 450 | return false; // Don't allow a plugin to ping itself |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | $api_params = array( |
| 454 | 454 | 'edd_action' => 'get_version', |
| 455 | - 'license' => ! empty( $data['license'] ) ? $data['license'] : '', |
|
| 456 | - 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false, |
|
| 457 | - 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false, |
|
| 458 | - 'version' => isset( $data['version'] ) ? $data['version'] : false, |
|
| 459 | - 'slug' => $data['slug'], |
|
| 460 | - 'author' => $data['author'], |
|
| 455 | + 'license' => ! empty( $data[ 'license' ] ) ? $data[ 'license' ] : '', |
|
| 456 | + 'item_name' => isset( $data[ 'item_name' ] ) ? $data[ 'item_name' ] : false, |
|
| 457 | + 'item_id' => isset( $data[ 'item_id' ] ) ? $data[ 'item_id' ] : false, |
|
| 458 | + 'version' => isset( $data[ 'version' ] ) ? $data[ 'version' ] : false, |
|
| 459 | + 'slug' => $data[ 'slug' ], |
|
| 460 | + 'author' => $data[ 'author' ], |
|
| 461 | 461 | 'url' => home_url(), |
| 462 | - 'beta' => ! empty( $data['beta'] ), |
|
| 462 | + 'beta' => ! empty( $data[ 'beta' ] ), |
|
| 463 | 463 | ); |
| 464 | 464 | |
| 465 | - $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) ); |
|
| 465 | + $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) ); |
|
| 466 | 466 | |
| 467 | 467 | if ( ! is_wp_error( $request ) ) { |
| 468 | 468 | $request = json_decode( wp_remote_retrieve_body( $request ) ); |
@@ -483,8 +483,8 @@ discard block |
||
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | if ( ! empty( $request->sections ) ) { |
| 486 | - foreach( $request->sections as $key => $section ) { |
|
| 487 | - $request->$key = (array) $section; |
|
| 486 | + foreach ( $request->sections as $key => $section ) { |
|
| 487 | + $request->$key = (array)$section; |
|
| 488 | 488 | } |
| 489 | 489 | } |
| 490 | 490 | |
@@ -498,35 +498,35 @@ discard block |
||
| 498 | 498 | |
| 499 | 499 | global $edd_plugin_data; |
| 500 | 500 | |
| 501 | - if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) { |
|
| 501 | + if ( empty( $_REQUEST[ 'edd_sl_action' ] ) || 'view_plugin_changelog' != $_REQUEST[ 'edd_sl_action' ] ) { |
|
| 502 | 502 | return; |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | - if( empty( $_REQUEST['plugin'] ) ) { |
|
| 505 | + if ( empty( $_REQUEST[ 'plugin' ] ) ) { |
|
| 506 | 506 | return; |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | - if( empty( $_REQUEST['slug'] ) ) { |
|
| 509 | + if ( empty( $_REQUEST[ 'slug' ] ) ) { |
|
| 510 | 510 | return; |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | - if( ! current_user_can( 'update_plugins' ) ) { |
|
| 513 | + if ( ! current_user_can( 'update_plugins' ) ) { |
|
| 514 | 514 | wp_die( __( 'You do not have permission to install plugin updates', 'gravityview' ), __( 'Error', 'gravityview' ), array( 'response' => 403 ) ); |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | - $data = $edd_plugin_data[ $_REQUEST['slug'] ]; |
|
| 517 | + $data = $edd_plugin_data[ $_REQUEST[ 'slug' ] ]; |
|
| 518 | 518 | $version_info = $this->get_cached_version_info(); |
| 519 | 519 | |
| 520 | - if( false === $version_info ) { |
|
| 520 | + if ( false === $version_info ) { |
|
| 521 | 521 | |
| 522 | 522 | $api_params = array( |
| 523 | 523 | 'edd_action' => 'get_version', |
| 524 | - 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false, |
|
| 525 | - 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false, |
|
| 526 | - 'slug' => $_REQUEST['slug'], |
|
| 527 | - 'author' => $data['author'], |
|
| 524 | + 'item_name' => isset( $data[ 'item_name' ] ) ? $data[ 'item_name' ] : false, |
|
| 525 | + 'item_id' => isset( $data[ 'item_id' ] ) ? $data[ 'item_id' ] : false, |
|
| 526 | + 'slug' => $_REQUEST[ 'slug' ], |
|
| 527 | + 'author' => $data[ 'author' ], |
|
| 528 | 528 | 'url' => home_url(), |
| 529 | - 'beta' => ! empty( $data['beta'] ) |
|
| 529 | + 'beta' => ! empty( $data[ 'beta' ] ) |
|
| 530 | 530 | ); |
| 531 | 531 | |
| 532 | 532 | $verify_ssl = $this->verify_ssl(); |
@@ -542,22 +542,22 @@ discard block |
||
| 542 | 542 | $version_info = false; |
| 543 | 543 | } |
| 544 | 544 | |
| 545 | - if( ! empty( $version_info ) ) { |
|
| 546 | - foreach( $version_info->sections as $key => $section ) { |
|
| 547 | - $version_info->$key = (array) $section; |
|
| 545 | + if ( ! empty( $version_info ) ) { |
|
| 546 | + foreach ( $version_info->sections as $key => $section ) { |
|
| 547 | + $version_info->$key = (array)$section; |
|
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | $this->set_version_info_cache( $version_info ); |
| 552 | 552 | |
| 553 | 553 | // Delete the unneeded option |
| 554 | - delete_option( md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $this->beta . '_version_info' ) ); |
|
| 554 | + delete_option( md5( 'edd_plugin_' . sanitize_key( $_REQUEST[ 'plugin' ] ) . '_' . $this->beta . '_version_info' ) ); |
|
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | if ( isset( $version_info->sections ) ) { |
| 558 | 558 | $sections = $this->convert_object_to_array( $version_info->sections ); |
| 559 | - if ( ! empty( $sections['changelog'] ) ) { |
|
| 560 | - echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections['changelog'] ) . '</div>'; |
|
| 559 | + if ( ! empty( $sections[ 'changelog' ] ) ) { |
|
| 560 | + echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections[ 'changelog' ] ) . '</div>'; |
|
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | 563 | |
@@ -572,25 +572,25 @@ discard block |
||
| 572 | 572 | */ |
| 573 | 573 | public function get_cached_version_info( $cache_key = '' ) { |
| 574 | 574 | |
| 575 | - if( empty( $cache_key ) ) { |
|
| 575 | + if ( empty( $cache_key ) ) { |
|
| 576 | 576 | $cache_key = $this->cache_key; |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | $cache = get_option( $cache_key ); |
| 580 | 580 | |
| 581 | - if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) { |
|
| 581 | + if ( empty( $cache[ 'timeout' ] ) || time() > $cache[ 'timeout' ] ) { |
|
| 582 | 582 | return false; // Cache is expired |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | // We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point. |
| 586 | - $cache['value'] = json_decode( $cache['value'] ); |
|
| 587 | - if ( ! empty( $cache['value']->icons ) ) { |
|
| 588 | - $cache['value']->icons = (array) $cache['value']->icons; |
|
| 589 | - } elseif ( $cache['value'] ) { |
|
| 590 | - $cache['value']->icons = array(); |
|
| 586 | + $cache[ 'value' ] = json_decode( $cache[ 'value' ] ); |
|
| 587 | + if ( ! empty( $cache[ 'value' ]->icons ) ) { |
|
| 588 | + $cache[ 'value' ]->icons = (array)$cache[ 'value' ]->icons; |
|
| 589 | + } elseif ( $cache[ 'value' ] ) { |
|
| 590 | + $cache[ 'value' ]->icons = array(); |
|
| 591 | 591 | } |
| 592 | 592 | |
| 593 | - return $cache['value']; |
|
| 593 | + return $cache[ 'value' ]; |
|
| 594 | 594 | |
| 595 | 595 | } |
| 596 | 596 | |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | */ |
| 603 | 603 | public function set_version_info_cache( $value = '', $cache_key = '' ) { |
| 604 | 604 | |
| 605 | - if( empty( $cache_key ) ) { |
|
| 605 | + if ( empty( $cache_key ) ) { |
|
| 606 | 606 | $cache_key = $this->cache_key; |
| 607 | 607 | } |
| 608 | 608 | |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | update_option( $cache_key, $data, 'no' ); |
| 615 | 615 | |
| 616 | 616 | // Delete the duplicate option |
| 617 | - delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ) ); |
|
| 617 | + delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data[ 'license' ] . $this->beta ) ) ); |
|
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | /** |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | * @return bool |
| 625 | 625 | */ |
| 626 | 626 | private function verify_ssl() { |
| 627 | - return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this ); |
|
| 627 | + return (bool)apply_filters( 'edd_sl_api_request_verify_ssl', true, $this ); |
|
| 628 | 628 | } |
| 629 | 629 | |
| 630 | 630 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | function __construct() { |
| 15 | 15 | |
| 16 | - $this->widget_description = __('Display a Gravity Forms form.', 'gravityview' ); |
|
| 16 | + $this->widget_description = __( 'Display a Gravity Forms form.', 'gravityview' ); |
|
| 17 | 17 | |
| 18 | 18 | $default_values = array( |
| 19 | 19 | 'header' => 1, |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | add_filter( 'gravityview/widget/hide_until_searched/whitelist', array( $this, 'add_to_allowlist' ) ); |
| 56 | 56 | |
| 57 | - parent::__construct( __( 'Gravity Forms', 'gravityview' ) , 'gravityforms', $default_values, $settings ); |
|
| 57 | + parent::__construct( __( 'Gravity Forms', 'gravityview' ), 'gravityforms', $default_values, $settings ); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -81,13 +81,13 @@ discard block |
||
| 81 | 81 | * gravityview_get_forms() is currently running too early as widgets_init runs before init and |
| 82 | 82 | * when most Gravity Forms plugins register their own fields like GP Terms of Service. |
| 83 | 83 | */ |
| 84 | - if( $doing_ajax || ( \GV\Admin_Request::is_admin() && ! GFForms::is_gravity_page() ) ) { |
|
| 84 | + if ( $doing_ajax || ( \GV\Admin_Request::is_admin() && ! GFForms::is_gravity_page() ) ) { |
|
| 85 | 85 | |
| 86 | 86 | // check for available gravity forms |
| 87 | 87 | $forms = gravityview_get_forms(); |
| 88 | 88 | |
| 89 | 89 | foreach ( $forms as $form ) { |
| 90 | - $choices[ $form['id'] ] = $form['title']; |
|
| 90 | + $choices[ $form[ 'id' ] ] = $form[ 'title' ]; |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | function add_to_allowlist( $allowlist ) { |
| 105 | 105 | |
| 106 | - $allowlist[] = 'gravityforms'; |
|
| 106 | + $allowlist[ ] = 'gravityforms'; |
|
| 107 | 107 | |
| 108 | 108 | return $allowlist; |
| 109 | 109 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @param string $content |
| 114 | 114 | * @param string $context |
| 115 | 115 | */ |
| 116 | - public function render_frontend( $widget_args, $content = '', $context = '') { |
|
| 116 | + public function render_frontend( $widget_args, $content = '', $context = '' ) { |
|
| 117 | 117 | |
| 118 | 118 | if ( ! $this->pre_render_frontend() ) { |
| 119 | 119 | return; |
@@ -21,13 +21,13 @@ |
||
| 21 | 21 | $plugin_hooks_files = glob( $include_path . 'class-gravityview-plugin-hooks-*.php' ); |
| 22 | 22 | |
| 23 | 23 | // Load all plugin files automatically |
| 24 | -foreach ( (array) $plugin_hooks_files as $plugin_hooks_file ) { |
|
| 24 | +foreach ( (array)$plugin_hooks_files as $plugin_hooks_file ) { |
|
| 25 | 25 | include $plugin_hooks_file; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | $theme_hooks_files = glob( $include_path . 'class-gravityview-theme-hooks-*.php' ); |
| 29 | 29 | |
| 30 | 30 | // Load all theme files automatically |
| 31 | -foreach ( (array) $theme_hooks_files as $theme_hooks_file ) { |
|
| 31 | +foreach ( (array)$theme_hooks_files as $theme_hooks_file ) { |
|
| 32 | 32 | include $theme_hooks_file; |
| 33 | 33 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | add_filter( 'icl_ls_languages', array( $this, 'wpml_ls_filter' ) ); |
| 66 | 66 | |
| 67 | - add_filter( 'gravityview_directory_link', array( $this, 'filter_gravityview_back_link') ); |
|
| 67 | + add_filter( 'gravityview_directory_link', array( $this, 'filter_gravityview_back_link' ) ); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | function filter_gravityview_back_link( $link ) { |
| 85 | 85 | global $wpml_url_filters; |
| 86 | 86 | |
| 87 | - if( $wpml_url_filters ) { |
|
| 87 | + if ( $wpml_url_filters ) { |
|
| 88 | 88 | $link = $wpml_url_filters->permalink_filter( $link, GravityView_frontend::getInstance()->getPostId() ); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | private function remove_url_hooks() { |
| 102 | 102 | global $wpml_url_filters; |
| 103 | 103 | |
| 104 | - if( ! $wpml_url_filters ) { |
|
| 104 | + if ( ! $wpml_url_filters ) { |
|
| 105 | 105 | return; |
| 106 | 106 | } |
| 107 | 107 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | private function add_url_hooks() { |
| 130 | 130 | global $wpml_url_filters; |
| 131 | 131 | |
| 132 | - if( ! $wpml_url_filters ) { |
|
| 132 | + if ( ! $wpml_url_filters ) { |
|
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | break; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - $languages[ $lang_code ]['url'] = $entry_link; |
|
| 229 | + $languages[ $lang_code ][ 'url' ] = $entry_link; |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | $this->add_url_hooks(); |
@@ -134,17 +134,17 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | add_filter( 'gravityview/sortable/field_blacklist', array( $this, '_filter_sortable_fields' ), 1 ); |
| 136 | 136 | |
| 137 | - if( $this->entry_meta_key ) { |
|
| 137 | + if ( $this->entry_meta_key ) { |
|
| 138 | 138 | add_filter( 'gform_entry_meta', array( $this, 'add_entry_meta' ) ); |
| 139 | 139 | add_filter( 'gravityview/common/sortable_fields', array( $this, 'add_sortable_field' ), 10, 2 ); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - if( $this->_custom_merge_tag ) { |
|
| 142 | + if ( $this->_custom_merge_tag ) { |
|
| 143 | 143 | add_filter( 'gform_custom_merge_tags', array( $this, '_filter_gform_custom_merge_tags' ), 10, 4 ); |
| 144 | 144 | add_filter( 'gform_replace_merge_tags', array( $this, '_filter_gform_replace_merge_tags' ), 10, 7 ); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - if( 'meta' === $this->group || '' !== $this->default_search_label ) { |
|
| 147 | + if ( 'meta' === $this->group || '' !== $this->default_search_label ) { |
|
| 148 | 148 | add_filter( 'gravityview_search_field_label', array( $this, 'set_default_search_label' ), 10, 3 ); |
| 149 | 149 | } |
| 150 | 150 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | * Auto-assign label from Gravity Forms label, if exists |
| 153 | 153 | * @since 1.20 |
| 154 | 154 | */ |
| 155 | - if( empty( $this->label ) && ! empty( $this->_gf_field_class_name ) && class_exists( $this->_gf_field_class_name ) ) { |
|
| 155 | + if ( empty( $this->label ) && ! empty( $this->_gf_field_class_name ) && class_exists( $this->_gf_field_class_name ) ) { |
|
| 156 | 156 | $this->label = ucfirst( GF_Fields::get( $this->name )->get_form_editor_field_title() ); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | 'type' => $this->name |
| 180 | 180 | ); |
| 181 | 181 | |
| 182 | - $fields["{$this->entry_meta_key}"] = $added_field; |
|
| 182 | + $fields[ "{$this->entry_meta_key}" ] = $added_field; |
|
| 183 | 183 | |
| 184 | 184 | return $fields; |
| 185 | 185 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | function set_default_search_label( $label = '', $gf_field = null, $field = array() ) { |
| 201 | 201 | |
| 202 | - if( $this->name === $field['field'] && '' === $label ) { |
|
| 202 | + if ( $this->name === $field[ 'field' ] && '' === $label ) { |
|
| 203 | 203 | $label = esc_html( $this->default_search_label ); |
| 204 | 204 | } |
| 205 | 205 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * |
| 221 | 221 | * @return string Original text if {_custom_merge_tag} isn't found. Otherwise, replaced text. |
| 222 | 222 | */ |
| 223 | - public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
| 223 | + public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
| 224 | 224 | |
| 225 | 225 | // Is there is field merge tag? Strip whitespace off the ned, too. |
| 226 | 226 | preg_match_all( '/{' . preg_quote( $this->_custom_merge_tag ) . ':?(.*?)(?:\s)?}/ism', $text, $matches, PREG_SET_ORDER ); |
@@ -253,19 +253,19 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
| 255 | 255 | |
| 256 | - foreach( $matches as $match ) { |
|
| 256 | + foreach ( $matches as $match ) { |
|
| 257 | 257 | |
| 258 | - $full_tag = $match[0]; |
|
| 258 | + $full_tag = $match[ 0 ]; |
|
| 259 | 259 | |
| 260 | 260 | // Strip the Merge Tags |
| 261 | - $tag = str_replace( array( '{', '}'), '', $full_tag ); |
|
| 261 | + $tag = str_replace( array( '{', '}' ), '', $full_tag ); |
|
| 262 | 262 | |
| 263 | 263 | // Replace the value from the entry, if exists |
| 264 | - if( isset( $entry[ $tag ] ) ) { |
|
| 264 | + if ( isset( $entry[ $tag ] ) ) { |
|
| 265 | 265 | |
| 266 | 266 | $value = $entry[ $tag ]; |
| 267 | 267 | |
| 268 | - if( is_callable( array( $this, 'get_content') ) ) { |
|
| 268 | + if ( is_callable( array( $this, 'get_content' ) ) ) { |
|
| 269 | 269 | $value = $this->get_content( $value ); |
| 270 | 270 | } |
| 271 | 271 | |
@@ -338,8 +338,8 @@ discard block |
||
| 338 | 338 | */ |
| 339 | 339 | public function _filter_sortable_fields( $not_sortable ) { |
| 340 | 340 | |
| 341 | - if( ! $this->is_sortable ) { |
|
| 342 | - $not_sortable[] = $this->name; |
|
| 341 | + if ( ! $this->is_sortable ) { |
|
| 342 | + $not_sortable[ ] = $this->name; |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | return $not_sortable; |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | */ |
| 357 | 357 | function add_entry_meta( $entry_meta ) { |
| 358 | 358 | |
| 359 | - if( ! isset( $entry_meta["{$this->entry_meta_key}"] ) ) { |
|
| 359 | + if ( ! isset( $entry_meta[ "{$this->entry_meta_key}" ] ) ) { |
|
| 360 | 360 | |
| 361 | 361 | $added_meta = array( |
| 362 | 362 | 'label' => $this->label, |
@@ -365,13 +365,13 @@ discard block |
||
| 365 | 365 | ); |
| 366 | 366 | |
| 367 | 367 | if ( $this->entry_meta_update_callback && is_callable( $this->entry_meta_update_callback ) ) { |
| 368 | - $added_meta['update_entry_meta_callback'] = $this->entry_meta_update_callback; |
|
| 368 | + $added_meta[ 'update_entry_meta_callback' ] = $this->entry_meta_update_callback; |
|
| 369 | 369 | } |
| 370 | 370 | |
| 371 | - $entry_meta["{$this->entry_meta_key}"] = $added_meta; |
|
| 371 | + $entry_meta[ "{$this->entry_meta_key}" ] = $added_meta; |
|
| 372 | 372 | |
| 373 | 373 | } else { |
| 374 | - gravityview()->log->error( 'Entry meta already set: {meta_key}', array( 'meta_key' => $this->entry_meta_key, 'data' => $entry_meta["{$this->entry_meta_key}"] ) ); |
|
| 374 | + gravityview()->log->error( 'Entry meta already set: {meta_key}', array( 'meta_key' => $this->entry_meta_key, 'data' => $entry_meta[ "{$this->entry_meta_key}" ] ) ); |
|
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | return $entry_meta; |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | 'date_display' => array( |
| 401 | 401 | 'type' => 'text', |
| 402 | 402 | 'label' => __( 'Override Date Format', 'gravityview' ), |
| 403 | - 'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview'), '<a href="https://wordpress.org/support/article/formatting-date-and-time/" rel="external">', '</a>' ), |
|
| 403 | + 'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview' ), '<a href="https://wordpress.org/support/article/formatting-date-and-time/" rel="external">', '</a>' ), |
|
| 404 | 404 | /** |
| 405 | 405 | * @filter `gravityview_date_format` Override the date format with a [PHP date format](https://codex.wordpress.org/Formatting_Date_and_Time) |
| 406 | 406 | * @param[in,out] null|string $date_format Date Format (default: null) |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | |
| 427 | 427 | $options = $this->field_support_options(); |
| 428 | 428 | |
| 429 | - if( isset( $options[ $key ] ) ) { |
|
| 429 | + if ( isset( $options[ $key ] ) ) { |
|
| 430 | 430 | $field_options[ $key ] = $options[ $key ]; |
| 431 | 431 | } |
| 432 | 432 | |
@@ -490,11 +490,11 @@ discard block |
||
| 490 | 490 | $connected_form = \GV\Utils::_POST( 'form_id' ); |
| 491 | 491 | |
| 492 | 492 | // Otherwise, get the Form ID from the Post page |
| 493 | - if( empty( $connected_form ) ) { |
|
| 493 | + if ( empty( $connected_form ) ) { |
|
| 494 | 494 | $connected_form = gravityview_get_form_id( get_the_ID() ); |
| 495 | 495 | } |
| 496 | 496 | |
| 497 | - if( empty( $connected_form ) ) { |
|
| 497 | + if ( empty( $connected_form ) ) { |
|
| 498 | 498 | gravityview()->log->error( 'Form not found for form ID "{form_id}"', array( 'form_id' => $connected_form ) ); |
| 499 | 499 | return false; |
| 500 | 500 | } |
@@ -421,7 +421,7 @@ |
||
| 421 | 421 | </header> |
| 422 | 422 | <div class="gform-settings-panel__content" style="padding: 0 1rem 1.25rem"> |
| 423 | 423 | |
| 424 | -HTML; |
|
| 424 | +html; |
|
| 425 | 425 | } else { |
| 426 | 426 | echo '<div class="gv-uninstall-form-wrapper" style="font-size: 110%; padding: 15px 0;">'; |
| 427 | 427 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $setting_tabs = parent::get_app_settings_tabs(); |
| 119 | 119 | |
| 120 | 120 | foreach ( $setting_tabs as &$tab ) { |
| 121 | - if ( 'uninstall' !== $tab['name'] ) { |
|
| 121 | + if ( 'uninstall' !== $tab[ 'name' ] ) { |
|
| 122 | 122 | continue; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | // Add trash can icon to resemble the look and feel of the GF Settings page |
| 132 | - $tab['icon'] = 'dashicons-trash'; |
|
| 132 | + $tab[ 'icon' ] = 'dashicons-trash'; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | return array_filter( $setting_tabs ); |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function register_no_conflict( $items ) { |
| 146 | 146 | |
| 147 | - $items[] = 'gform_settings'; |
|
| 148 | - $items[] = 'gv-admin-edd-license'; |
|
| 147 | + $items[ ] = 'gform_settings'; |
|
| 148 | + $items[ ] = 'gv-admin-edd-license'; |
|
| 149 | 149 | |
| 150 | 150 | return $items; |
| 151 | 151 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | $href = add_query_arg( array( 'post_type' => 'gravityview', 'page' => 'gravityview_settings', 'view' => 'uninstall' ), admin_url( 'edit.php' ) ); |
| 198 | 198 | |
| 199 | - $uninstall_button = '<a href="' . esc_url( $href ) . '" class="' . gravityview_sanitize_html_class( $html_class ). '">' . esc_html__( 'Uninstall GravityView', 'gravityview' ) . '</a>'; |
|
| 199 | + $uninstall_button = '<a href="' . esc_url( $href ) . '" class="' . gravityview_sanitize_html_class( $html_class ) . '">' . esc_html__( 'Uninstall GravityView', 'gravityview' ) . '</a>'; |
|
| 200 | 200 | |
| 201 | 201 | $html .= $uninstall_button; |
| 202 | 202 | |
@@ -215,10 +215,10 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | public function settings_save( $field, $echo = true ) { |
| 217 | 217 | |
| 218 | - $field['type'] = 'submit'; |
|
| 219 | - $field['name'] = 'gform-settings-save'; |
|
| 220 | - $field['class'] = 'button button-primary primary button-hero'; |
|
| 221 | - $field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
| 218 | + $field[ 'type' ] = 'submit'; |
|
| 219 | + $field[ 'name' ] = 'gform-settings-save'; |
|
| 220 | + $field[ 'class' ] = 'button button-primary primary button-hero'; |
|
| 221 | + $field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
| 222 | 222 | |
| 223 | 223 | $html = $this->as_html( $field, false ); |
| 224 | 224 | |
@@ -240,8 +240,8 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | public function modify_app_settings_menu_title( $setting_tabs ) { |
| 242 | 242 | |
| 243 | - $setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview' ); |
|
| 244 | - $setting_tabs[0]['icon'] = 'dashicons-admin-settings'; |
|
| 243 | + $setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' ); |
|
| 244 | + $setting_tabs[ 0 ][ 'icon' ] = 'dashicons-admin-settings'; |
|
| 245 | 245 | |
| 246 | 246 | return $setting_tabs; |
| 247 | 247 | } |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | $i = 0; |
| 490 | 490 | while ( $i < 11 ) { |
| 491 | 491 | echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>'; |
| 492 | - $i ++; |
|
| 492 | + $i++; |
|
| 493 | 493 | } |
| 494 | 494 | ?> |
| 495 | 495 | </ul> |
@@ -694,14 +694,14 @@ discard block |
||
| 694 | 694 | */ |
| 695 | 695 | public function as_html( $field, $echo = true ) { |
| 696 | 696 | |
| 697 | - $field['type'] = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit', 'reset', 'button' ) ) ) ? $field['type'] : 'submit'; |
|
| 697 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
| 698 | 698 | |
| 699 | 699 | $attributes = $this->get_field_attributes( $field ); |
| 700 | 700 | $default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) ); |
| 701 | - $value = $this->get( $field['name'], $default_value ); |
|
| 701 | + $value = $this->get( $field[ 'name' ], $default_value ); |
|
| 702 | 702 | |
| 703 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary primary gfbutton'; |
|
| 704 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name']; |
|
| 703 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary primary gfbutton'; |
|
| 704 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
| 705 | 705 | |
| 706 | 706 | if ( empty( $value ) ) { |
| 707 | 707 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | $attributes = $this->get_field_attributes( $field ); |
| 711 | 711 | |
| 712 | 712 | $html = '<input |
| 713 | - type="' . $field['type'] . '" |
|
| 713 | + type="' . $field[ 'type' ] . '" |
|
| 714 | 714 | name="' . esc_attr( $name ) . '" |
| 715 | 715 | value="' . $value . '" ' . |
| 716 | 716 | implode( ' ', $attributes ) . |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | */ |
| 745 | 745 | public function is_save_postback() { |
| 746 | 746 | |
| 747 | - return isset( $_POST['gform-settings-save'] ) && isset( $_POST['_gravityview_save_settings_nonce'] ); |
|
| 747 | + return isset( $_POST[ 'gform-settings-save' ] ) && isset( $_POST[ '_gravityview_save_settings_nonce' ] ); |
|
| 748 | 748 | } |
| 749 | 749 | |
| 750 | 750 | /** |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | |
| 857 | 857 | $scripts = parent::scripts(); |
| 858 | 858 | |
| 859 | - $scripts[] = array( |
|
| 859 | + $scripts[ ] = array( |
|
| 860 | 860 | 'handle' => 'gform_tooltip_init', |
| 861 | 861 | 'enqueue' => array( |
| 862 | 862 | array( |
@@ -884,11 +884,11 @@ discard block |
||
| 884 | 884 | ); |
| 885 | 885 | |
| 886 | 886 | // This file was removed from 2.5 |
| 887 | - if( ! gravityview()->plugin->is_GF_25() ) { |
|
| 888 | - $deps[] = 'gform_tooltip'; |
|
| 887 | + if ( ! gravityview()->plugin->is_GF_25() ) { |
|
| 888 | + $deps[ ] = 'gform_tooltip'; |
|
| 889 | 889 | } |
| 890 | 890 | |
| 891 | - $styles[] = array( |
|
| 891 | + $styles[ ] = array( |
|
| 892 | 892 | 'handle' => 'gravityview_settings', |
| 893 | 893 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
| 894 | 894 | 'version' => Plugin::$version, |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | 'name' => 'support-email', |
| 976 | 976 | 'type' => 'text', |
| 977 | 977 | 'validate' => 'email', |
| 978 | - 'default_value' => $default_settings['support-email'], |
|
| 978 | + 'default_value' => $default_settings[ 'support-email' ], |
|
| 979 | 979 | 'label' => __( 'Support Email', 'gravityview' ), |
| 980 | 980 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
| 981 | 981 | 'class' => 'code regular-text', |
@@ -987,7 +987,7 @@ discard block |
||
| 987 | 987 | 'name' => 'support_port', |
| 988 | 988 | 'type' => 'radio', |
| 989 | 989 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
| 990 | - 'default_value' => $default_settings['support_port'], |
|
| 990 | + 'default_value' => $default_settings[ 'support_port' ], |
|
| 991 | 991 | 'horizontal' => 1, |
| 992 | 992 | 'choices' => array( |
| 993 | 993 | array( |
@@ -1006,7 +1006,7 @@ discard block |
||
| 1006 | 1006 | 'name' => 'no-conflict-mode', |
| 1007 | 1007 | 'type' => 'radio', |
| 1008 | 1008 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
| 1009 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
| 1009 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
| 1010 | 1010 | 'horizontal' => 1, |
| 1011 | 1011 | 'choices' => array( |
| 1012 | 1012 | array( |
@@ -1028,7 +1028,7 @@ discard block |
||
| 1028 | 1028 | 'name' => 'rest_api', |
| 1029 | 1029 | 'type' => 'radio', |
| 1030 | 1030 | 'label' => __( 'REST API', 'gravityview' ), |
| 1031 | - 'default_value' => $default_settings['rest_api'], |
|
| 1031 | + 'default_value' => $default_settings[ 'rest_api' ], |
|
| 1032 | 1032 | 'horizontal' => 1, |
| 1033 | 1033 | 'choices' => array( |
| 1034 | 1034 | array( |
@@ -1047,7 +1047,7 @@ discard block |
||
| 1047 | 1047 | 'name' => 'powered_by', |
| 1048 | 1048 | 'type' => 'checkbox', |
| 1049 | 1049 | 'label' => __( 'Display "Powered By" Link', 'gravityview' ), |
| 1050 | - 'default_value' => $default_settings['powered_by'], |
|
| 1050 | + 'default_value' => $default_settings[ 'powered_by' ], |
|
| 1051 | 1051 | 'choices' => array( |
| 1052 | 1052 | array( |
| 1053 | 1053 | 'label' => esc_html__( 'Display a "Powered by GravityView" link', 'gravityview' ), |
@@ -1072,7 +1072,7 @@ discard block |
||
| 1072 | 1072 | 'name' => 'beta', |
| 1073 | 1073 | 'type' => 'checkbox', |
| 1074 | 1074 | 'label' => __( 'Become a Beta Tester', 'gravityview' ), |
| 1075 | - 'default_value' => $default_settings['beta'], |
|
| 1075 | + 'default_value' => $default_settings[ 'beta' ], |
|
| 1076 | 1076 | 'horizontal' => 1, |
| 1077 | 1077 | 'choices' => array( |
| 1078 | 1078 | array( |
@@ -1106,17 +1106,17 @@ discard block |
||
| 1106 | 1106 | * @since 1.7.4 |
| 1107 | 1107 | */ |
| 1108 | 1108 | foreach ( $fields as &$field ) { |
| 1109 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' ); |
|
| 1110 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' ); |
|
| 1111 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' ); |
|
| 1112 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' ); |
|
| 1109 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' ); |
|
| 1110 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' ); |
|
| 1111 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' ); |
|
| 1112 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' ); |
|
| 1113 | 1113 | |
| 1114 | 1114 | if ( $disabled_attribute ) { |
| 1115 | - $field['disabled'] = $disabled_attribute; |
|
| 1115 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | - if ( empty( $field['disabled'] ) ) { |
|
| 1119 | - unset( $field['disabled'] ); |
|
| 1118 | + if ( empty( $field[ 'disabled' ] ) ) { |
|
| 1119 | + unset( $field[ 'disabled' ] ); |
|
| 1120 | 1120 | } |
| 1121 | 1121 | } |
| 1122 | 1122 | |
@@ -1128,23 +1128,23 @@ discard block |
||
| 1128 | 1128 | 'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates & support.', 'gravityview' ), |
| 1129 | 1129 | 'type' => 'edd_license', |
| 1130 | 1130 | 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
| 1131 | - 'default_value' => $default_settings['license_key'], |
|
| 1131 | + 'default_value' => $default_settings[ 'license_key' ], |
|
| 1132 | 1132 | 'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
| 1133 | 1133 | ), |
| 1134 | 1134 | array( |
| 1135 | 1135 | 'name' => 'license_key_response', |
| 1136 | - 'default_value' => $default_settings['license_key_response'], |
|
| 1136 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
| 1137 | 1137 | 'type' => 'hidden', |
| 1138 | 1138 | ), |
| 1139 | 1139 | array( |
| 1140 | 1140 | 'name' => 'license_key_status', |
| 1141 | - 'default_value' => $default_settings['license_key_status'], |
|
| 1141 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
| 1142 | 1142 | 'type' => 'hidden', |
| 1143 | 1143 | ), |
| 1144 | 1144 | ); |
| 1145 | 1145 | |
| 1146 | 1146 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
| 1147 | - $license_fields[0] = array_merge( $license_fields[0], array( |
|
| 1147 | + $license_fields[ 0 ] = array_merge( $license_fields[ 0 ], array( |
|
| 1148 | 1148 | 'disabled' => true, |
| 1149 | 1149 | 'title' => __( 'The license key is defined by your site\'s configuration file.', 'gravityview' ), |
| 1150 | 1150 | ) ); |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | |
| 1156 | 1156 | if ( \gravityview()->plugin->is_GF_25() ) { |
| 1157 | 1157 | |
| 1158 | - $sections[] = array( |
|
| 1158 | + $sections[ ] = array( |
|
| 1159 | 1159 | 'title' => __( 'GravityView License', 'gravityview' ), |
| 1160 | 1160 | 'class' => 'gform-settings-panel--full gv-settings-panel--license', |
| 1161 | 1161 | 'description' => $version_info, |
@@ -1173,7 +1173,7 @@ discard block |
||
| 1173 | 1173 | ) ); |
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | - $sections[] = array( |
|
| 1176 | + $sections[ ] = array( |
|
| 1177 | 1177 | 'title' => ( gravityview()->plugin->is_GF_25() ? __( 'GravityView Settings', 'gravityview' ) : null ), |
| 1178 | 1178 | 'class' => 'gform-settings-panel--full gv-settings-panel--core', |
| 1179 | 1179 | 'fields' => $fields, |
@@ -1197,8 +1197,8 @@ discard block |
||
| 1197 | 1197 | |
| 1198 | 1198 | if ( $disabled_attribute ) { |
| 1199 | 1199 | foreach ( $extension_sections as &$section ) { |
| 1200 | - foreach ( $section['fields'] as &$field ) { |
|
| 1201 | - $field['disabled'] = $disabled_attribute; |
|
| 1200 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
| 1201 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 1202 | 1202 | } |
| 1203 | 1203 | } |
| 1204 | 1204 | } |
@@ -1264,7 +1264,7 @@ discard block |
||
| 1264 | 1264 | public function settings_edd_license( $field, $echo = true ) { |
| 1265 | 1265 | |
| 1266 | 1266 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
| 1267 | - $field['input_type'] = 'password'; |
|
| 1267 | + $field[ 'input_type' ] = 'password'; |
|
| 1268 | 1268 | } |
| 1269 | 1269 | |
| 1270 | 1270 | $text = $this->settings_text( $field, false ); |
@@ -1316,7 +1316,7 @@ discard block |
||
| 1316 | 1316 | |
| 1317 | 1317 | ?> |
| 1318 | 1318 | |
| 1319 | - <tr id="gaddon-setting-row-<?php echo esc_attr( $field['name'] ); ?>"> |
|
| 1319 | + <tr id="gaddon-setting-row-<?php echo esc_attr( $field[ 'name' ] ); ?>"> |
|
| 1320 | 1320 | <td colspan="2"> |
| 1321 | 1321 | <?php $this->single_setting( $field ); ?> |
| 1322 | 1322 | </td> |
@@ -1342,8 +1342,8 @@ discard block |
||
| 1342 | 1342 | */ |
| 1343 | 1343 | public function single_setting_row( $field ) { |
| 1344 | 1344 | |
| 1345 | - $field['gv_description'] = Utils::get( $field, 'description' ); |
|
| 1346 | - $field['description'] = Utils::get( $field, 'subtitle' ); |
|
| 1345 | + $field[ 'gv_description' ] = Utils::get( $field, 'description' ); |
|
| 1346 | + $field[ 'description' ] = Utils::get( $field, 'subtitle' ); |
|
| 1347 | 1347 | parent::single_setting_row( $field ); |
| 1348 | 1348 | } |
| 1349 | 1349 | |
@@ -1404,8 +1404,8 @@ discard block |
||
| 1404 | 1404 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
| 1405 | 1405 | if ( ! $added_message && ( $local_key !== $response_key ) ) { |
| 1406 | 1406 | |
| 1407 | - unset( $posted_settings['license_key_response'] ); |
|
| 1408 | - unset( $posted_settings['license_key_status'] ); |
|
| 1407 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
| 1408 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
| 1409 | 1409 | |
| 1410 | 1410 | \GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
| 1411 | 1411 | |