@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | var $is_searchable = true; |
13 | 13 | |
14 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
14 | + var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' ); |
|
15 | 15 | |
16 | 16 | var $_gf_field_class_name = 'GF_Field_Post_Category'; |
17 | 17 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $entry = GFAPI::get_entry( $entry_id ); |
47 | 47 | $post_id = \GV\Utils::get( $entry, 'post_id' ); |
48 | 48 | |
49 | - if( empty( $post_id ) ) { |
|
49 | + if ( empty( $post_id ) ) { |
|
50 | 50 | return false; |
51 | 51 | } |
52 | 52 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | $post_category_fields = GFAPI::get_fields_by_type( $form, 'post_category' ); |
56 | 56 | |
57 | - if( $post_category_fields ) { |
|
57 | + if ( $post_category_fields ) { |
|
58 | 58 | |
59 | 59 | $updated_categories = array(); |
60 | 60 | |
@@ -121,18 +121,18 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @return mixed |
123 | 123 | */ |
124 | - function edit_entry_post_category_choices( $choices, $field, $form_id ) { |
|
124 | + function edit_entry_post_category_choices( $choices, $field, $form_id ) { |
|
125 | 125 | |
126 | - $entry = GravityView_Edit_Entry::getInstance()->instances['render']->get_entry(); |
|
126 | + $entry = GravityView_Edit_Entry::getInstance()->instances[ 'render' ]->get_entry(); |
|
127 | 127 | |
128 | 128 | // $entry['post_id'] should always be set, but we check to make sure. |
129 | - if( $entry && isset( $entry['post_id'] ) && $post_id = $entry['post_id'] ) { |
|
129 | + if ( $entry && isset( $entry[ 'post_id' ] ) && $post_id = $entry[ 'post_id' ] ) { |
|
130 | 130 | |
131 | 131 | $post_categories = wp_get_post_categories( $post_id, array( 'fields' => 'ids' ) ); |
132 | 132 | |
133 | 133 | // Always use the live value |
134 | 134 | foreach ( $choices as &$choice ) { |
135 | - $choice['isSelected'] = in_array( $choice['value'], array_values( $post_categories ) ); |
|
135 | + $choice[ 'isSelected' ] = in_array( $choice[ 'value' ], array_values( $post_categories ) ); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
@@ -141,15 +141,15 @@ discard block |
||
141 | 141 | |
142 | 142 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
143 | 143 | |
144 | - if( 'edit' === $context ) { |
|
144 | + if ( 'edit' === $context ) { |
|
145 | 145 | return $field_options; |
146 | 146 | } |
147 | 147 | |
148 | - $this->add_field_support('dynamic_data', $field_options ); |
|
149 | - $this->add_field_support('link_to_term', $field_options ); |
|
150 | - $this->add_field_support('new_window', $field_options ); |
|
148 | + $this->add_field_support( 'dynamic_data', $field_options ); |
|
149 | + $this->add_field_support( 'link_to_term', $field_options ); |
|
150 | + $this->add_field_support( 'new_window', $field_options ); |
|
151 | 151 | |
152 | - $field_options['new_window']['requires'] = 'link_to_term'; |
|
152 | + $field_options[ 'new_window' ][ 'requires' ] = 'link_to_term'; |
|
153 | 153 | |
154 | 154 | return $field_options; |
155 | 155 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | var $is_searchable = true; |
16 | 16 | |
17 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
17 | + var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' ); |
|
18 | 18 | |
19 | 19 | var $_gf_field_class_name = 'GF_Field_Post_Tags'; |
20 | 20 | |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | |
30 | 30 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
31 | 31 | |
32 | - if( 'edit' === $context ) { |
|
32 | + if ( 'edit' === $context ) { |
|
33 | 33 | return $field_options; |
34 | 34 | } |
35 | 35 | |
36 | - $this->add_field_support('dynamic_data', $field_options ); |
|
37 | - $this->add_field_support('link_to_term', $field_options ); |
|
38 | - $this->add_field_support('new_window', $field_options ); |
|
36 | + $this->add_field_support( 'dynamic_data', $field_options ); |
|
37 | + $this->add_field_support( 'link_to_term', $field_options ); |
|
38 | + $this->add_field_support( 'new_window', $field_options ); |
|
39 | 39 | |
40 | - $field_options['new_window']['requires'] = 'link_to_term'; |
|
40 | + $field_options[ 'new_window' ][ 'requires' ] = 'link_to_term'; |
|
41 | 41 | |
42 | 42 | return $field_options; |
43 | 43 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | if ( 'single' === $context ) { |
36 | - unset( $field_options['new_window'] ); |
|
36 | + unset( $field_options[ 'new_window' ] ); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | return $field_options; |
@@ -16,17 +16,17 @@ |
||
16 | 16 | */ |
17 | 17 | function gravityview_register_gravityview_widgets() { |
18 | 18 | |
19 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' ); |
|
19 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' ); |
|
20 | 20 | |
21 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/search-widget/class-search-widget.php' ); |
|
22 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-custom-content.php' ); |
|
23 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-gravityforms.php' ); |
|
24 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-page-size.php' ); |
|
25 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-pagination-info.php' ); |
|
26 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-page-links.php' ); |
|
21 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/search-widget/class-search-widget.php' ); |
|
22 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-custom-content.php' ); |
|
23 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-gravityforms.php' ); |
|
24 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-page-size.php' ); |
|
25 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-pagination-info.php' ); |
|
26 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-page-links.php' ); |
|
27 | 27 | |
28 | - if( class_exists('GFPolls') ) { |
|
29 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/poll/class-gravityview-widget-poll.php' ); |
|
28 | + if ( class_exists( 'GFPolls' ) ) { |
|
29 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/poll/class-gravityview-widget-poll.php' ); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | } |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | $value = $this->get_value( $atts ); |
62 | 62 | |
63 | 63 | if ( false === $operator && is_null( $value ) ) { |
64 | - if ( false !== $atts['if'] ) { // Only-if test |
|
65 | - $match = $authed && ! in_array( strtolower( $atts['if'] ), array( '', '0', 'false', 'no' ) ); |
|
64 | + if ( false !== $atts[ 'if' ] ) { // Only-if test |
|
65 | + $match = $authed && ! in_array( strtolower( $atts[ 'if' ] ), array( '', '0', 'false', 'no' ) ); |
|
66 | 66 | } else { |
67 | 67 | $match = $authed; // Just login test |
68 | 68 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | // Need to match all AND |
83 | 83 | foreach ( $and_values as $and_value ) { |
84 | - $match = $authed && \GVCommon::matches_operation( $atts['if'], $and_value, $operator ); |
|
84 | + $match = $authed && \GVCommon::matches_operation( $atts[ 'if' ], $and_value, $operator ); |
|
85 | 85 | if ( ! $match ) { |
86 | 86 | break; |
87 | 87 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // Only need to match a single OR |
93 | 93 | foreach ( $or_values as $or_value ) { |
94 | 94 | |
95 | - $match = \GVCommon::matches_operation( $atts['if'], $or_value, $operator ); |
|
95 | + $match = \GVCommon::matches_operation( $atts[ 'if' ], $or_value, $operator ); |
|
96 | 96 | |
97 | 97 | // Negate the negative operators |
98 | 98 | if ( ( $authed && $match ) || ( $authed && ( ! $match && in_array( $operator, array( 'isnot', 'not_contains', 'not_in' ) ) ) ) ) { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | } else { |
104 | - $match = $authed && \GVCommon::matches_operation( $atts['if'], $value, $operator ); |
|
104 | + $match = $authed && \GVCommon::matches_operation( $atts[ 'if' ], $value, $operator ); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | $output = $this->get_output( $match, $atts, $output ); |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | * @return string The output. |
190 | 190 | */ |
191 | 191 | private function get_output( $match, $atts, $content ) { |
192 | - if ( ! $match && ! empty( $atts['else'] ) ) { |
|
193 | - return $atts['else']; // Attributized else is easy :) |
|
192 | + if ( ! $match && ! empty( $atts[ 'else' ] ) ) { |
|
193 | + return $atts[ 'else' ]; // Attributized else is easy :) |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | $if = ''; |
@@ -317,18 +317,18 @@ discard block |
||
317 | 317 | $atts = array_intersect_key( $supplied_atts, $atts ); |
318 | 318 | |
319 | 319 | // Strip whitespace if it's not default false |
320 | - if ( isset( $atts['if'] ) && is_string( $atts['if'] ) ) { |
|
321 | - $atts['if'] = trim( $atts['if'] ); |
|
320 | + if ( isset( $atts[ 'if' ] ) && is_string( $atts[ 'if' ] ) ) { |
|
321 | + $atts[ 'if' ] = trim( $atts[ 'if' ] ); |
|
322 | 322 | } else { |
323 | - $atts['if'] = false; |
|
323 | + $atts[ 'if' ] = false; |
|
324 | 324 | } |
325 | 325 | |
326 | - if ( isset( $atts['logged_in'] ) ) { |
|
326 | + if ( isset( $atts[ 'logged_in' ] ) ) { |
|
327 | 327 | // Truthy |
328 | - if ( in_array( strtolower( $atts['logged_in'] ), array( '0', 'false', 'no' ) ) ) { |
|
329 | - $atts['logged_in'] = false; |
|
328 | + if ( in_array( strtolower( $atts[ 'logged_in' ] ), array( '0', 'false', 'no' ) ) ) { |
|
329 | + $atts[ 'logged_in' ] = false; |
|
330 | 330 | } else { |
331 | - $atts['logged_in'] = true; |
|
331 | + $atts[ 'logged_in' ] = true; |
|
332 | 332 | } |
333 | 333 | } |
334 | 334 |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | add_filter( 'gravityview/fields/fileupload/link_atts', array( $this, 'fileupload_link_atts' ), 10, 4 ); |
24 | 24 | add_filter( 'gravityview/get_link/allowed_atts', array( $this, 'allowed_atts' ) ); |
25 | 25 | |
26 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts') ); |
|
27 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles') ); |
|
26 | + add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
|
27 | + add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); |
|
28 | 28 | |
29 | 29 | add_action( 'gravityview/template/after', array( $this, 'print_scripts' ) ); |
30 | 30 | |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | remove_filter( 'gravityview/fields/fileupload/link_atts', array( $this, 'fileupload_link_atts' ), 10 ); |
93 | 93 | remove_filter( 'gravityview/get_link/allowed_atts', array( $this, 'allowed_atts' ) ); |
94 | 94 | |
95 | - remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts') ); |
|
96 | - remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles') ); |
|
95 | + remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
|
96 | + remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); |
|
97 | 97 | |
98 | 98 | remove_action( 'wp_footer', array( $this, 'output_footer' ) ); |
99 | 99 | } |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | if ( ! $detailed ) { |
556 | 556 | $defaults = array(); |
557 | 557 | foreach ( $default_settings as $key => $value ) { |
558 | - $defaults[ $key ] = $value['value']; |
|
558 | + $defaults[ $key ] = $value[ 'value' ]; |
|
559 | 559 | } |
560 | 560 | return $defaults; |
561 | 561 | |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | // If the $group argument is set for the method, |
567 | 567 | // ignore any settings that aren't in that group. |
568 | 568 | if ( ! empty( $group ) && is_string( $group ) ) { |
569 | - if ( empty( $value['group'] ) || $value['group'] !== $group ) { |
|
569 | + if ( empty( $value[ 'group' ] ) || $value[ 'group' ] !== $group ) { |
|
570 | 570 | unset( $default_settings[ $key ] ); |
571 | 571 | } |
572 | 572 | } |
@@ -114,14 +114,14 @@ |
||
114 | 114 | /** Require critical legacy core files. @todo Deprecate */ |
115 | 115 | require_once $this->plugin->dir( 'includes/import-functions.php' ); |
116 | 116 | require_once $this->plugin->dir( 'includes/helper-functions.php' ); |
117 | - require_once $this->plugin->dir( 'includes/class-common.php'); |
|
118 | - require_once $this->plugin->dir( 'includes/connector-functions.php'); |
|
117 | + require_once $this->plugin->dir( 'includes/class-common.php' ); |
|
118 | + require_once $this->plugin->dir( 'includes/connector-functions.php' ); |
|
119 | 119 | require_once $this->plugin->dir( 'includes/class-gravityview-compatibility.php' ); |
120 | 120 | require_once $this->plugin->dir( 'includes/class-gravityview-roles-capabilities.php' ); |
121 | 121 | require_once $this->plugin->dir( 'includes/class-gravityview-admin-notices.php' ); |
122 | 122 | require_once $this->plugin->dir( 'includes/class-admin.php' ); |
123 | - require_once $this->plugin->dir( 'includes/class-post-types.php'); |
|
124 | - require_once $this->plugin->dir( 'includes/class-cache.php'); |
|
123 | + require_once $this->plugin->dir( 'includes/class-post-types.php' ); |
|
124 | + require_once $this->plugin->dir( 'includes/class-cache.php' ); |
|
125 | 125 | |
126 | 126 | /** |
127 | 127 | * GravityView extensions and widgets. |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | */ |
47 | 47 | function gravityview_import_helper_fix_line_breaks( $postmeta = array(), $post_id = 0, $post = array() ) { |
48 | 48 | |
49 | - if ( empty( $post['postmeta'] ) ) { |
|
49 | + if ( empty( $post[ 'postmeta' ] ) ) { |
|
50 | 50 | return $postmeta; |
51 | 51 | } |
52 | 52 | |
53 | - if ( 'gravityview' !== $post['post_type'] ) { |
|
53 | + if ( 'gravityview' !== $post[ 'post_type' ] ) { |
|
54 | 54 | return $postmeta; |
55 | 55 | } |
56 | 56 | |
@@ -62,27 +62,27 @@ discard block |
||
62 | 62 | $performed_fix = false; |
63 | 63 | |
64 | 64 | foreach ( $postmeta as &$meta ) { |
65 | - $key = $meta['key']; |
|
65 | + $key = $meta[ 'key' ]; |
|
66 | 66 | |
67 | 67 | if ( ! in_array( $key, $keys_to_fix, true ) ) { |
68 | 68 | continue; |
69 | 69 | } |
70 | 70 | |
71 | - $is_valid_serialized_data = maybe_unserialize( $meta['value'] ); |
|
71 | + $is_valid_serialized_data = maybe_unserialize( $meta[ 'value' ] ); |
|
72 | 72 | |
73 | 73 | // The values are not corrupted serialized data. No need to fix. |
74 | 74 | if ( false !== $is_valid_serialized_data ) { |
75 | 75 | continue; |
76 | 76 | } |
77 | 77 | |
78 | - $meta['value'] = str_replace( "\n", "\n\n", $meta['value'] ); |
|
78 | + $meta[ 'value' ] = str_replace( "\n", "\n\n", $meta[ 'value' ] ); |
|
79 | 79 | |
80 | 80 | $performed_fix = true; |
81 | 81 | } |
82 | 82 | |
83 | 83 | // Leave a note that this modification has been done. We'll use it later. |
84 | 84 | if ( $performed_fix ) { |
85 | - $postmeta[] = array( |
|
85 | + $postmeta[ ] = array( |
|
86 | 86 | 'key' => '_gravityview_fixed_import_serialization', |
87 | 87 | 'value' => 1, |
88 | 88 | ); |