@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @return void |
38 | 38 | */ |
39 | - public function emergency($message, array $context = array()) |
|
39 | + public function emergency( $message, array $context = array() ) |
|
40 | 40 | { |
41 | - $this->log(LogLevel::EMERGENCY, $message, $context); |
|
41 | + $this->log( LogLevel::EMERGENCY, $message, $context ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return void |
54 | 54 | */ |
55 | - public function alert($message, array $context = array()) |
|
55 | + public function alert( $message, array $context = array() ) |
|
56 | 56 | { |
57 | - $this->log(LogLevel::ALERT, $message, $context); |
|
57 | + $this->log( LogLevel::ALERT, $message, $context ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return void |
69 | 69 | */ |
70 | - public function critical($message, array $context = array()) |
|
70 | + public function critical( $message, array $context = array() ) |
|
71 | 71 | { |
72 | - $this->log(LogLevel::CRITICAL, $message, $context); |
|
72 | + $this->log( LogLevel::CRITICAL, $message, $context ); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return void |
83 | 83 | */ |
84 | - public function error($message, array $context = array()) |
|
84 | + public function error( $message, array $context = array() ) |
|
85 | 85 | { |
86 | - $this->log(LogLevel::ERROR, $message, $context); |
|
86 | + $this->log( LogLevel::ERROR, $message, $context ); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @return void |
99 | 99 | */ |
100 | - public function warning($message, array $context = array()) |
|
100 | + public function warning( $message, array $context = array() ) |
|
101 | 101 | { |
102 | - $this->log(LogLevel::WARNING, $message, $context); |
|
102 | + $this->log( LogLevel::WARNING, $message, $context ); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @return void |
112 | 112 | */ |
113 | - public function notice($message, array $context = array()) |
|
113 | + public function notice( $message, array $context = array() ) |
|
114 | 114 | { |
115 | - $this->log(LogLevel::NOTICE, $message, $context); |
|
115 | + $this->log( LogLevel::NOTICE, $message, $context ); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @return void |
127 | 127 | */ |
128 | - public function info($message, array $context = array()) |
|
128 | + public function info( $message, array $context = array() ) |
|
129 | 129 | { |
130 | - $this->log(LogLevel::INFO, $message, $context); |
|
130 | + $this->log( LogLevel::INFO, $message, $context ); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | * |
139 | 139 | * @return void |
140 | 140 | */ |
141 | - public function debug($message, array $context = array()) |
|
141 | + public function debug( $message, array $context = array() ) |
|
142 | 142 | { |
143 | - $this->log(LogLevel::DEBUG, $message, $context); |
|
143 | + $this->log( LogLevel::DEBUG, $message, $context ); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -55,10 +55,10 @@ |
||
55 | 55 | $search_criteria[ $key ] = $field_filters; |
56 | 56 | } |
57 | 57 | |
58 | - if ( ! empty( $b[ $key ]['mode'] ) ) { |
|
59 | - $search_criteria[ $key ]['mode' ] = $b[ $key ]['mode']; |
|
60 | - } else if ( ! empty( $a[ $key ]['mode'] ) ) { |
|
61 | - $search_criteria[ $key ]['mode' ] = $a[ $key ]['mode']; |
|
58 | + if ( ! empty( $b[ $key ][ 'mode' ] ) ) { |
|
59 | + $search_criteria[ $key ][ 'mode' ] = $b[ $key ][ 'mode' ]; |
|
60 | + } else if ( ! empty( $a[ $key ][ 'mode' ] ) ) { |
|
61 | + $search_criteria[ $key ][ 'mode' ] = $a[ $key ][ 'mode' ]; |
|
62 | 62 | } |
63 | 63 | break; |
64 | 64 | case 'start_date': |
@@ -7,9 +7,9 @@ discard block |
||
7 | 7 | |
8 | 8 | function __construct() { |
9 | 9 | |
10 | - add_action( 'gravityview_log_error', array( $this, 'log_error'), 10, 2 ); |
|
10 | + add_action( 'gravityview_log_error', array( $this, 'log_error' ), 10, 2 ); |
|
11 | 11 | |
12 | - add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 ); |
|
12 | + add_action( 'gravityview_log_debug', array( $this, 'log_debug' ), 10, 2 ); |
|
13 | 13 | |
14 | 14 | // Enable debug with Gravity Forms Logging Add-on |
15 | 15 | add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | include_once( GRAVITYVIEW_DIR . 'includes/class-debug-bar.php' ); |
35 | 35 | } |
36 | 36 | |
37 | - $panels[] = new GravityView_Debug_Bar; |
|
37 | + $panels[ ] = new GravityView_Debug_Bar; |
|
38 | 38 | |
39 | 39 | return $panels; |
40 | 40 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param array $supported_plugins List of plugins |
45 | 45 | */ |
46 | 46 | public function enable_gform_logging( $supported_plugins ) { |
47 | - $supported_plugins['gravityview'] = 'GravityView'; |
|
47 | + $supported_plugins[ 'gravityview' ] = 'GravityView'; |
|
48 | 48 | return $supported_plugins; |
49 | 49 | } |
50 | 50 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @return string "print_r" or "var_export" |
73 | 73 | */ |
74 | 74 | static function get_print_function() { |
75 | - if( ob_get_level() > 0 ) { |
|
75 | + if ( ob_get_level() > 0 ) { |
|
76 | 76 | $function = 'var_export'; |
77 | 77 | } else { |
78 | 78 | $function = 'print_r'; |
@@ -90,17 +90,17 @@ discard block |
||
90 | 90 | 'data' => $data, |
91 | 91 | ); |
92 | 92 | |
93 | - if( !in_array( $notice, self::$notices ) ) { |
|
94 | - self::$notices[] = $notice; |
|
93 | + if ( ! in_array( $notice, self::$notices ) ) { |
|
94 | + self::$notices[ ] = $notice; |
|
95 | 95 | } |
96 | 96 | |
97 | - if ( class_exists("GFLogging") ) { |
|
97 | + if ( class_exists( "GFLogging" ) ) { |
|
98 | 98 | GFLogging::include_logger(); |
99 | - GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
99 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $data, true ), KLogger::DEBUG ); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | - static function log_error( $message = '', $data = null ) { |
|
103 | + static function log_error( $message = '', $data = null ) { |
|
104 | 104 | |
105 | 105 | $function = self::get_print_function(); |
106 | 106 | |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | 'backtrace' => function_exists( 'wp_debug_backtrace_summary' ) ? wp_debug_backtrace_summary( null, 3 ) : '', |
111 | 111 | ); |
112 | 112 | |
113 | - if( !in_array( $error, self::$errors ) ) { |
|
114 | - self::$errors[] = $error; |
|
113 | + if ( ! in_array( $error, self::$errors ) ) { |
|
114 | + self::$errors[ ] = $error; |
|
115 | 115 | } |
116 | 116 | |
117 | - if ( class_exists("GFLogging") ) { |
|
117 | + if ( class_exists( "GFLogging" ) ) { |
|
118 | 118 | GFLogging::include_logger(); |
119 | - GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
119 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $error, true ), KLogger::ERROR ); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 |
@@ -11,10 +11,10 @@ |
||
11 | 11 | ?> |
12 | 12 | |
13 | 13 | <div class="gv-search-box gv-search-date"> |
14 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
15 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
14 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
15 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
16 | 16 | <?php } ?> |
17 | 17 | <p> |
18 | - <input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" > |
|
18 | + <input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" > |
|
19 | 19 | </p> |
20 | 20 | </div> |
21 | 21 | \ No newline at end of file |
@@ -10,10 +10,10 @@ |
||
10 | 10 | |
11 | 11 | ?> |
12 | 12 | <div class="gv-search-box gv-search-field-text"> |
13 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
14 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
13 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
14 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
15 | 15 | <?php } ?> |
16 | 16 | <p> |
17 | - <input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>"> |
|
17 | + <input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>"> |
|
18 | 18 | </p> |
19 | 19 | </div> |
20 | 20 | \ No newline at end of file |
@@ -12,8 +12,8 @@ |
||
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class="gv-search-box gv-search-field-single_checkbox"> |
15 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" class="gv-check-radio"> |
|
16 | - <input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" <?php checked( '1', $search_field['value'], true ); ?>> |
|
17 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { echo esc_html( $search_field['label'] ); } ?> |
|
15 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" class="gv-check-radio"> |
|
16 | + <input type="checkbox" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" <?php checked( '1', $search_field[ 'value' ], true ); ?>> |
|
17 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { echo esc_html( $search_field[ 'label' ] ); } ?> |
|
18 | 18 | </label> |
19 | 19 | </div> |
20 | 20 | \ No newline at end of file |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | * @since 1.0 |
35 | 35 | */ |
36 | 36 | public function __construct() { |
37 | - add_action( 'admin_menu', array( $this, 'admin_menus'), 200 ); |
|
37 | + add_action( 'admin_menu', array( $this, 'admin_menus' ), 200 ); |
|
38 | 38 | add_action( 'admin_head', array( $this, 'admin_head' ) ); |
39 | - add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
40 | - add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page'), 10, 2 ); |
|
39 | + add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
40 | + add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page' ), 10, 2 ); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | // Add help page to GravityView menu |
54 | 54 | add_submenu_page( |
55 | 55 | 'edit.php?post_type=gravityview', |
56 | - __('GravityView: Getting Started', 'gravityview'), |
|
57 | - __('Getting Started', 'gravityview'), |
|
56 | + __( 'GravityView: Getting Started', 'gravityview' ), |
|
57 | + __( 'Getting Started', 'gravityview' ), |
|
58 | 58 | $this->minimum_capability, |
59 | 59 | 'gv-getting-started', |
60 | 60 | array( $this, 'getting_started_screen' ) |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | * |
88 | 88 | * @return boolean $is_page True: yep; false: nope |
89 | 89 | */ |
90 | - public function is_dashboard_page($is_page = false, $hook = NULL) { |
|
90 | + public function is_dashboard_page( $is_page = false, $hook = NULL ) { |
|
91 | 91 | global $plugin_page; |
92 | 92 | |
93 | - if($is_page) { return $is_page; } |
|
93 | + if ( $is_page ) { return $is_page; } |
|
94 | 94 | |
95 | 95 | return in_array( $plugin_page, array( 'gv-about', 'gv-credits', 'gv-getting-started' ) ); |
96 | 96 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-credits' ); |
109 | 109 | remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-changelog' ); |
110 | 110 | |
111 | - if( !$this->is_dashboard_page() ) { return; } |
|
111 | + if ( ! $this->is_dashboard_page() ) { return; } |
|
112 | 112 | |
113 | 113 | ?> |
114 | 114 | <style type="text/css" media="screen" xmlns="http://www.w3.org/1999/html"> |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | // Don't fetch -beta, etc. |
133 | 133 | list( $display_version ) = explode( '-', GravityView_Plugin::version ); |
134 | 134 | |
135 | - $selected = !empty( $plugin_page ) ? $plugin_page : 'gv-getting-started'; |
|
135 | + $selected = ! empty( $plugin_page ) ? $plugin_page : 'gv-getting-started'; |
|
136 | 136 | |
137 | 137 | echo gravityview_get_floaty( 132 ); |
138 | 138 | ?> |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | <div class="about-text"><?php esc_html_e( 'Thank you for installing GravityView. Beautifully display your Gravity Forms entries.', 'gravityview' ); ?></div> |
142 | 142 | |
143 | 143 | <h2 class="nav-tab-wrapper clear"> |
144 | - <a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>"> |
|
144 | + <a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>"> |
|
145 | 145 | <?php _e( "Getting Started", 'gravityview' ); ?> |
146 | 146 | </a> |
147 | - <a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>"> |
|
147 | + <a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>"> |
|
148 | 148 | <?php _e( "List of Changes", 'gravityview' ); ?> |
149 | 149 | </a> |
150 | - <a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>"> |
|
150 | + <a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>"> |
|
151 | 151 | <?php _e( 'Credits', 'gravityview' ); ?> |
152 | 152 | </a> |
153 | 153 | </h2> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | <h3>Create a View</h3> |
183 | 183 | |
184 | 184 | <ol class="ol-decimal"> |
185 | - <li>Go to <a href="<?php echo admin_url('post-new.php?post_type=gravityview'); ?>">Views > New View</a></li> |
|
185 | + <li>Go to <a href="<?php echo admin_url( 'post-new.php?post_type=gravityview' ); ?>">Views > New View</a></li> |
|
186 | 186 | <li>If you want to <strong>create a new form</strong>, click the "Use a Form Preset" button</li> |
187 | 187 | <li>If you want to <strong>use an existing form’s entries</strong>, select from the dropdown.</li> |
188 | 188 | <li>Select the type of View you would like to create. There are two core types of Views: <strong>Table</strong> and <strong>Listing</strong>. |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | </ul> |
465 | 465 | |
466 | 466 | <h4><?php esc_attr_e( 'Want to contribute?', 'gravityview' ); ?></h4> |
467 | - <p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview'), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p> |
|
467 | + <p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview' ), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p> |
|
468 | 468 | </div> |
469 | 469 | </div> |
470 | 470 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | global $plugin_page; |
508 | 508 | |
509 | 509 | // Bail if we're just editing the plugin |
510 | - if( $plugin_page === 'plugin-editor.php' ) { return; } |
|
510 | + if ( $plugin_page === 'plugin-editor.php' ) { return; } |
|
511 | 511 | |
512 | 512 | // Bail if no activation redirect |
513 | 513 | if ( ! get_transient( '_gv_activation_redirect' ) ) { return; } |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | $upgrade = get_option( 'gv_version_upgraded_from' ); |
519 | 519 | |
520 | 520 | // Don't do anything if they've already seen the new version info |
521 | - if( $upgrade === GravityView_Plugin::version ) { |
|
521 | + if ( $upgrade === GravityView_Plugin::version ) { |
|
522 | 522 | return; |
523 | 523 | } |
524 | 524 | |
@@ -526,10 +526,10 @@ discard block |
||
526 | 526 | update_option( 'gv_version_upgraded_from', GravityView_Plugin::version ); |
527 | 527 | |
528 | 528 | // Bail if activating from network, or bulk |
529 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; } |
|
529 | + if ( is_network_admin() || isset( $_GET[ 'activate-multi' ] ) ) { return; } |
|
530 | 530 | |
531 | 531 | // First time install |
532 | - if( ! $upgrade ) { |
|
532 | + if ( ! $upgrade ) { |
|
533 | 533 | wp_safe_redirect( admin_url( 'edit.php?post_type=gravityview&page=gv-getting-started' ) ); exit; |
534 | 534 | } |
535 | 535 | // Update |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | $sidebars_widgets = wp_get_sidebars_widgets(); |
82 | - if ( empty( $sidebars_widgets[ $matches[1] ] ) ) { |
|
82 | + if ( empty( $sidebars_widgets[ $matches[ 1 ] ] ) ) { |
|
83 | 83 | return $shortcodes; |
84 | 84 | } |
85 | 85 | |
86 | - foreach ( $sidebars_widgets[ $matches[1] ] as $widgets ) { |
|
86 | + foreach ( $sidebars_widgets[ $matches[ 1 ] ] as $widgets ) { |
|
87 | 87 | if ( |
88 | 88 | /** |
89 | 89 | * Blacklisted widgets. |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | strpos( $widgets, 'gv_recent_entries' ) === 0 |
93 | 93 | ) { |
94 | 94 | |
95 | - $shortcodes []= 'et_pb_sidebar'; |
|
95 | + $shortcodes [ ] = 'et_pb_sidebar'; |
|
96 | 96 | break; |
97 | 97 | } |
98 | 98 | } |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | |
43 | 43 | $args = wp_parse_args( $args, $defaults ); |
44 | 44 | |
45 | - $forms = gravityview_get_forms( (bool) $args['active'], (bool) $args['trash'] ); |
|
45 | + $forms = gravityview_get_forms( (bool)$args[ 'active' ], (bool)$args[ 'trash' ] ); |
|
46 | 46 | |
47 | - if( array() === $args['options'] ) { |
|
47 | + if ( array() === $args[ 'options' ] ) { |
|
48 | 48 | foreach ( $forms as $form ) { |
49 | 49 | |
50 | - if ( in_array( $form['id'], $args['exclude'] ) ) { |
|
50 | + if ( in_array( $form[ 'id' ], $args[ 'exclude' ] ) ) { |
|
51 | 51 | continue; |
52 | 52 | } |
53 | 53 | |
54 | - $args['options'][ $form['id'] ] = esc_html( $form['title'] ); |
|
54 | + $args[ 'options' ][ $form[ 'id' ] ] = esc_html( $form[ 'title' ] ); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -83,15 +83,15 @@ discard block |
||
83 | 83 | |
84 | 84 | $args = wp_parse_args( $args, $defaults ); |
85 | 85 | |
86 | - if( empty( $args['form_id'] ) ) { |
|
86 | + if ( empty( $args[ 'form_id' ] ) ) { |
|
87 | 87 | return ''; |
88 | 88 | } |
89 | 89 | |
90 | - $fields = GVCommon::get_sortable_fields_array( $args['form_id'] ); |
|
90 | + $fields = GVCommon::get_sortable_fields_array( $args[ 'form_id' ] ); |
|
91 | 91 | |
92 | - if( array() === $args['options'] ) { |
|
92 | + if ( array() === $args[ 'options' ] ) { |
|
93 | 93 | foreach ( $fields as $field_id => $field ) { |
94 | - $args['options'][ $field_id ] = esc_html( $field['label'] ); |
|
94 | + $args[ 'options' ][ $field_id ] = esc_html( $field[ 'label' ] ); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
@@ -127,43 +127,43 @@ discard block |
||
127 | 127 | $args = wp_parse_args( $args, $defaults ); |
128 | 128 | |
129 | 129 | $data_elements = ''; |
130 | - foreach ( $args['data'] as $key => $value ) { |
|
130 | + foreach ( $args[ 'data' ] as $key => $value ) { |
|
131 | 131 | $data_elements .= ' data-' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
132 | 132 | } |
133 | 133 | |
134 | - if( $args['multiple'] ) { |
|
134 | + if ( $args[ 'multiple' ] ) { |
|
135 | 135 | $multiple = ' MULTIPLE'; |
136 | 136 | } else { |
137 | 137 | $multiple = ''; |
138 | 138 | } |
139 | 139 | |
140 | - if( $args['placeholder'] ) { |
|
141 | - $placeholder = $args['placeholder']; |
|
140 | + if ( $args[ 'placeholder' ] ) { |
|
141 | + $placeholder = $args[ 'placeholder' ]; |
|
142 | 142 | } else { |
143 | 143 | $placeholder = ''; |
144 | 144 | } |
145 | 145 | |
146 | - $disabled = $args['disabled'] ? ' disabled="disabled"' : ''; |
|
147 | - $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) ); |
|
148 | - $output = '<select name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( str_replace( '-', '_', $args['id'] ) ) . '" class="gravityview-select ' . $class . '"' . $multiple . $disabled . ' data-placeholder="' . $placeholder . '"'. $data_elements . '>'; |
|
146 | + $disabled = $args[ 'disabled' ] ? ' disabled="disabled"' : ''; |
|
147 | + $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args[ 'class' ] ) ) ); |
|
148 | + $output = '<select name="' . esc_attr( $args[ 'name' ] ) . '" id="' . esc_attr( str_replace( '-', '_', $args[ 'id' ] ) ) . '" class="gravityview-select ' . $class . '"' . $multiple . $disabled . ' data-placeholder="' . $placeholder . '"' . $data_elements . '>'; |
|
149 | 149 | |
150 | - if ( ! empty( $args['options'] ) ) { |
|
150 | + if ( ! empty( $args[ 'options' ] ) ) { |
|
151 | 151 | |
152 | - if ( $args['show_option_none'] ) { |
|
153 | - if( $args['multiple'] ) { |
|
154 | - $selected = selected( true, in_array( -1, $args['selected'] ), false ); |
|
152 | + if ( $args[ 'show_option_none' ] ) { |
|
153 | + if ( $args[ 'multiple' ] ) { |
|
154 | + $selected = selected( true, in_array( -1, $args[ 'selected' ] ), false ); |
|
155 | 155 | } else { |
156 | - $selected = selected( $args['selected'], -1, false ); |
|
156 | + $selected = selected( $args[ 'selected' ], -1, false ); |
|
157 | 157 | } |
158 | - $output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>'; |
|
158 | + $output .= '<option value="-1"' . $selected . '>' . esc_html( $args[ 'show_option_none' ] ) . '</option>'; |
|
159 | 159 | } |
160 | 160 | |
161 | - foreach( $args['options'] as $key => $option ) { |
|
161 | + foreach ( $args[ 'options' ] as $key => $option ) { |
|
162 | 162 | |
163 | - if( $args['multiple'] && is_array( $args['selected'] ) ) { |
|
164 | - $selected = selected( true, in_array( $key, $args['selected'], true ), false ); |
|
163 | + if ( $args[ 'multiple' ] && is_array( $args[ 'selected' ] ) ) { |
|
164 | + $selected = selected( true, in_array( $key, $args[ 'selected' ], true ), false ); |
|
165 | 165 | } else { |
166 | - $selected = selected( $args['selected'], $key, false ); |
|
166 | + $selected = selected( $args[ 'selected' ], $key, false ); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | $output .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option ) . '</option>'; |