@@ -50,7 +50,7 @@ |
||
| 50 | 50 | // Remove 'Styling Template' from titles. |
| 51 | 51 | foreach ( $api_info as $id => $template ) { |
| 52 | 52 | if ( isset( $template['name'] ) ) { |
| 53 | - $api_info[ $id ]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
| 53 | + $api_info[$id]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | 'text-color' => $style->post_content['text_color'], |
| 41 | 41 | 'submit-bg-color' => $style->post_content['submit_bg_color'], |
| 42 | 42 | ); |
| 43 | - $index = 0; |
|
| 43 | + $index = 0; |
|
| 44 | 44 | foreach ( $colors as $css_var_name => $color ) { |
| 45 | 45 | if ( 0 !== strpos( $color, 'rgb' ) ) { |
| 46 | 46 | $color = '#' . $color; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | 'style' => 'background-color: var(--' . $css_var_name . ')', |
| 52 | 52 | ); |
| 53 | 53 | |
| 54 | - ++$index; |
|
| 54 | + ++ $index; |
|
| 55 | 55 | ?> |
| 56 | 56 | <div <?php FrmAppHelper::array_to_html_params( $circle_params, true ); ?>></div> |
| 57 | 57 | <?php |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | if ( isset( $addon['categories'] ) ) { |
| 106 | 106 | $cats = array_intersect( $this->skip_categories(), $addon['categories'] ); |
| 107 | 107 | if ( ! empty( $cats ) ) { |
| 108 | - unset( $addons[ $k ] ); |
|
| 108 | + unset( $addons[$k] ); |
|
| 109 | 109 | continue; |
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | if ( ! array_key_exists( 'is_new', $addon ) && array_key_exists( 'released', $addon ) ) { |
| 114 | - $addons[ $k ]['is_new'] = $this->is_new( $addon ); |
|
| 114 | + $addons[$k]['is_new'] = $this->is_new( $addon ); |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | return $addon; |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 157 | - $plugin = $addons[ $download_id ]; |
|
| 156 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 157 | + $plugin = $addons[$download_id]; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | return $plugin; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $page = $this->get_pagenum(); |
| 21 | 21 | $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' ); |
| 22 | 22 | |
| 23 | - $mode = self::get_param( |
|
| 23 | + $mode = self::get_param( |
|
| 24 | 24 | array( |
| 25 | 25 | 'param' => 'mode', |
| 26 | 26 | 'default' => 'list', |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | 'default' => 'name', |
| 33 | 33 | ) |
| 34 | 34 | ); |
| 35 | - $order = self::get_param( |
|
| 35 | + $order = self::get_param( |
|
| 36 | 36 | array( |
| 37 | 37 | 'param' => 'order', |
| 38 | 38 | 'default' => 'ASC', |
| 39 | 39 | ) |
| 40 | 40 | ); |
| 41 | - $start = self::get_param( |
|
| 41 | + $start = self::get_param( |
|
| 42 | 42 | array( |
| 43 | 43 | 'param' => 'start', |
| 44 | 44 | 'default' => ( $page - 1 ) * $per_page, |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $counts = FrmForm::get_count(); |
| 163 | 163 | $form_type = FrmAppHelper::simple_get( 'form_type', 'sanitize_title', 'published' ); |
| 164 | 164 | |
| 165 | - if ( isset( $statuses[ $form_type ] ) ) { |
|
| 165 | + if ( isset( $statuses[$form_type] ) ) { |
|
| 166 | 166 | $counts->$form_type = $this->total_items; |
| 167 | 167 | } |
| 168 | 168 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | if ( $counts->{$status} || 'draft' !== $status ) { |
| 185 | 185 | /* translators: %1$s: Status, %2$s: Number of items */ |
| 186 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 186 | + $links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | unset( $status, $name ); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | private function get_actions( &$actions, $item, $edit_link ) { |
| 349 | 349 | $new_actions = FrmFormsHelper::get_action_links( $item->id, $item ); |
| 350 | 350 | foreach ( $new_actions as $link => $action ) { |
| 351 | - $new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
| 351 | + $new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | if ( 'trash' == $this->status ) { |
@@ -80,12 +80,12 @@ discard block |
||
| 80 | 80 | $show_intervals = array( 50, 200, 500 ); |
| 81 | 81 | $asked = $this->review_status['asked']; |
| 82 | 82 | |
| 83 | - if ( ! isset( $show_intervals[ $asked ] ) ) { |
|
| 83 | + if ( ! isset( $show_intervals[$asked] ) ) { |
|
| 84 | 84 | return; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $entries = FrmEntry::getRecordCount(); |
| 88 | - $count = $show_intervals[ $asked ]; |
|
| 88 | + $count = $show_intervals[$asked]; |
|
| 89 | 89 | $user = wp_get_current_user(); |
| 90 | 90 | |
| 91 | 91 | // Only show review request if the site has collected enough entries |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $requests = $message->get_messages(); |
| 135 | 135 | $key = $this->inbox_key . ( $asked ? $asked : '' ); |
| 136 | 136 | |
| 137 | - if ( isset( $requests[ $key ] ) ) { |
|
| 137 | + if ( isset( $requests[$key] ) ) { |
|
| 138 | 138 | return; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * @return bool |
| 174 | 174 | */ |
| 175 | 175 | private function has_later_request( $requests, $asked ) { |
| 176 | - return isset( $requests[ $this->inbox_key . ( $asked + 1 ) ] ) || isset( $requests[ $this->inbox_key . ( $asked + 2 ) ] ); |
|
| 176 | + return isset( $requests[$this->inbox_key . ( $asked + 1 )] ) || isset( $requests[$this->inbox_key . ( $asked + 2 )] ); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @return void |
| 87 | 87 | */ |
| 88 | 88 | private function init_style_settings( $atts ) { |
| 89 | - $style_settings = array( |
|
| 89 | + $style_settings = array( |
|
| 90 | 90 | 'border_color' => 'dddddd', |
| 91 | 91 | 'bg_color' => 'f7f7f7', |
| 92 | 92 | 'text_color' => '444444', |
@@ -97,12 +97,12 @@ discard block |
||
| 97 | 97 | $this->style_settings = apply_filters( 'frm_show_entry_styles', $style_settings ); |
| 98 | 98 | |
| 99 | 99 | foreach ( $this->style_settings as $key => $setting ) { |
| 100 | - if ( isset( $atts[ $key ] ) && $atts[ $key ] !== '' ) { |
|
| 101 | - $this->style_settings[ $key ] = $atts[ $key ]; |
|
| 100 | + if ( isset( $atts[$key] ) && $atts[$key] !== '' ) { |
|
| 101 | + $this->style_settings[$key] = $atts[$key]; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | if ( $this->is_color_setting( $key ) ) { |
| 105 | - $this->style_settings[ $key ] = $this->get_color_markup( $this->style_settings[ $key ] ); |
|
| 105 | + $this->style_settings[$key] = $this->get_color_markup( $this->style_settings[$key] ); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @return void |
| 60 | 60 | */ |
| 61 | 61 | public function set( $key, $value ) { |
| 62 | - $this->state[ $key ] = $value; |
|
| 62 | + $this->state[$key] = $value; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | public function get( $key, $default ) { |
| 78 | - if ( isset( $this->state[ $key ] ) ) { |
|
| 79 | - return $this->state[ $key ]; |
|
| 78 | + if ( isset( $this->state[$key] ) ) { |
|
| 79 | + return $this->state[$key]; |
|
| 80 | 80 | } |
| 81 | 81 | return $default; |
| 82 | 82 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | private function compressed_state() { |
| 172 | 172 | $compressed = array(); |
| 173 | 173 | foreach ( $this->state as $key => $value ) { |
| 174 | - $compressed[ self::compressed_key( $key ) ] = $value; |
|
| 174 | + $compressed[self::compressed_key( $key )] = $value; |
|
| 175 | 175 | } |
| 176 | 176 | return $compressed; |
| 177 | 177 | } |
@@ -65,12 +65,12 @@ |
||
| 65 | 65 | $string->read( 1 ); |
| 66 | 66 | |
| 67 | 67 | $val = array(); |
| 68 | - for ( $i = 0; $i < $count; $i++ ) { |
|
| 68 | + for ( $i = 0; $i < $count; $i ++ ) { |
|
| 69 | 69 | $array_key = $this->do_parse( $string ); |
| 70 | 70 | $array_value = $this->do_parse( $string ); |
| 71 | 71 | |
| 72 | 72 | if ( ! is_array( $array_key ) ) { |
| 73 | - $val[ $array_key ] = $array_value; |
|
| 73 | + $val[$array_key] = $array_value; |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
@@ -240,26 +240,26 @@ discard block |
||
| 240 | 240 | public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) { |
| 241 | 241 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
| 242 | 242 | if ( ! $action || ! is_object( $action ) ) { |
| 243 | - $form_options[ $opt . 'action' ] = self::get_default_action_type(); |
|
| 244 | - $form_options[ $opt . 'msg' ] = self::get_default_msg(); |
|
| 243 | + $form_options[$opt . 'action'] = self::get_default_action_type(); |
|
| 244 | + $form_options[$opt . 'msg'] = self::get_default_msg(); |
|
| 245 | 245 | |
| 246 | 246 | return; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - $form_options[ $opt . 'action' ] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
| 249 | + $form_options[$opt . 'action'] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
| 250 | 250 | |
| 251 | - switch ( $form_options[ $opt . 'action' ] ) { |
|
| 251 | + switch ( $form_options[$opt . 'action'] ) { |
|
| 252 | 252 | case 'redirect': |
| 253 | - $form_options[ $opt . 'url' ] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
| 253 | + $form_options[$opt . 'url'] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
| 254 | 254 | $form_options['open_in_new_tab'] = ! empty( $action->post_content['open_in_new_tab'] ); |
| 255 | 255 | break; |
| 256 | 256 | |
| 257 | 257 | case 'page': |
| 258 | - $form_options[ $opt . 'page_id' ] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
| 258 | + $form_options[$opt . 'page_id'] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
| 259 | 259 | break; |
| 260 | 260 | |
| 261 | 261 | default: |
| 262 | - $form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
| 262 | + $form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
| 263 | 263 | $form_options['show_form'] = ! empty( $action->post_content['show_form'] ); |
| 264 | 264 | } |
| 265 | 265 | } |
@@ -348,20 +348,20 @@ discard block |
||
| 348 | 348 | private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) { |
| 349 | 349 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
| 350 | 350 | $data = array( |
| 351 | - 'success_action' => isset( $form_options[ $opt . 'action' ] ) ? $form_options[ $opt . 'action' ] : self::get_default_action_type(), |
|
| 351 | + 'success_action' => isset( $form_options[$opt . 'action'] ) ? $form_options[$opt . 'action'] : self::get_default_action_type(), |
|
| 352 | 352 | ); |
| 353 | 353 | |
| 354 | 354 | switch ( $data['success_action'] ) { |
| 355 | 355 | case 'redirect': |
| 356 | - $data['success_url'] = isset( $form_options[ $opt . 'url' ] ) ? $form_options[ $opt . 'url' ] : ''; |
|
| 356 | + $data['success_url'] = isset( $form_options[$opt . 'url'] ) ? $form_options[$opt . 'url'] : ''; |
|
| 357 | 357 | break; |
| 358 | 358 | |
| 359 | 359 | case 'page': |
| 360 | - $data['success_page_id'] = isset( $form_options[ $opt . 'page_id' ] ) ? $form_options[ $opt . 'page_id' ] : ''; |
|
| 360 | + $data['success_page_id'] = isset( $form_options[$opt . 'page_id'] ) ? $form_options[$opt . 'page_id'] : ''; |
|
| 361 | 361 | break; |
| 362 | 362 | |
| 363 | 363 | default: |
| 364 | - $data['success_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : self::get_default_msg(); |
|
| 364 | + $data['success_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : self::get_default_msg(); |
|
| 365 | 365 | $data['show_form'] = ! empty( $form_options['show_form'] ); |
| 366 | 366 | } |
| 367 | 367 | |