@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | function load() { |
26 | 26 | |
27 | - if( !is_admin() ) { |
|
27 | + if ( ! is_admin() ) { |
|
28 | 28 | return; |
29 | 29 | } |
30 | 30 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | add_filter( 'gravityview_template_edit_link_options', array( $this, 'edit_link_field_options' ), 10, 5 ); |
39 | 39 | |
40 | 40 | // add tooltips |
41 | - add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'tooltips') ); |
|
41 | + add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'tooltips' ) ); |
|
42 | 42 | |
43 | 43 | // custom fields' options for zone EDIT |
44 | 44 | add_filter( 'gravityview_template_field_options', array( $this, 'field_options' ), 10, 6 ); |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | */ |
78 | 78 | function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) { |
79 | 79 | |
80 | - if( $zone !== 'edit' ) { |
|
80 | + if ( $zone !== 'edit' ) { |
|
81 | 81 | |
82 | - $entry_default_fields['edit_link'] = array( |
|
83 | - 'label' => __('Link to Edit Entry', 'gravityview'), |
|
82 | + $entry_default_fields[ 'edit_link' ] = array( |
|
83 | + 'label' => __( 'Link to Edit Entry', 'gravityview' ), |
|
84 | 84 | 'type' => 'edit_link', |
85 | - 'desc' => __('A link to edit the entry. Visible based on View settings.', 'gravityview'), |
|
85 | + 'desc' => __( 'A link to edit the entry. Visible based on View settings.', 'gravityview' ), |
|
86 | 86 | 'icon' => 'dashicons-welcome-write-blog', |
87 | 87 | ); |
88 | 88 | |
@@ -107,12 +107,12 @@ discard block |
||
107 | 107 | $caps = $visibility_caps; |
108 | 108 | |
109 | 109 | // If we're configuring fields in the edit context, we want a limited selection |
110 | - if( $context === 'edit' ) { |
|
110 | + if ( $context === 'edit' ) { |
|
111 | 111 | |
112 | 112 | // Remove other built-in caps. |
113 | - unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['delete_others_posts'] ); |
|
113 | + unset( $caps[ 'publish_posts' ], $caps[ 'gravityforms_view_entries' ], $caps[ 'delete_others_posts' ] ); |
|
114 | 114 | |
115 | - $caps['read'] = _x('Entry Creator','User capability', 'gravityview'); |
|
115 | + $caps[ 'read' ] = _x( 'Entry Creator', 'User capability', 'gravityview' ); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | return $caps; |
@@ -132,20 +132,20 @@ discard block |
||
132 | 132 | function edit_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
133 | 133 | |
134 | 134 | // Always a link, never a filter |
135 | - unset( $field_options['show_as_link'], $field_options['search_filter'] ); |
|
135 | + unset( $field_options[ 'show_as_link' ], $field_options[ 'search_filter' ] ); |
|
136 | 136 | |
137 | 137 | // Edit Entry link should only appear to visitors capable of editing entries |
138 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
138 | + unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] ); |
|
139 | 139 | |
140 | - $add_option['edit_link'] = array( |
|
140 | + $add_option[ 'edit_link' ] = array( |
|
141 | 141 | 'type' => 'text', |
142 | 142 | 'label' => __( 'Edit Link Text', 'gravityview' ), |
143 | 143 | 'desc' => NULL, |
144 | - 'value' => __('Edit Entry', 'gravityview'), |
|
144 | + 'value' => __( 'Edit Entry', 'gravityview' ), |
|
145 | 145 | 'merge_tags' => true, |
146 | 146 | ); |
147 | 147 | |
148 | - $add_option['new_window'] = array( |
|
148 | + $add_option[ 'new_window' ] = array( |
|
149 | 149 | 'type' => 'checkbox', |
150 | 150 | 'label' => __( 'Open link in a new tab or window?', 'gravityview' ), |
151 | 151 | 'value' => false, |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | |
166 | 166 | $return = $tooltips; |
167 | 167 | |
168 | - $return['allow_edit_cap'] = array( |
|
169 | - 'title' => __('Limiting Edit Access', 'gravityview'), |
|
170 | - 'value' => __('Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview'), |
|
168 | + $return[ 'allow_edit_cap' ] = array( |
|
169 | + 'title' => __( 'Limiting Edit Access', 'gravityview' ), |
|
170 | + 'value' => __( 'Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview' ), |
|
171 | 171 | ); |
172 | 172 | |
173 | 173 | return $return; |
@@ -188,12 +188,12 @@ discard block |
||
188 | 188 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
189 | 189 | |
190 | 190 | // We only want to modify the settings for the edit context |
191 | - if( 'edit' !== $context ) { |
|
191 | + if ( 'edit' !== $context ) { |
|
192 | 192 | return $field_options; |
193 | 193 | } |
194 | 194 | |
195 | 195 | // Entry field is only for logged in users |
196 | - unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] ); |
|
196 | + unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] ); |
|
197 | 197 | |
198 | 198 | $add_options = array( |
199 | 199 | 'allow_edit_cap' => array( |