@@ -34,23 +34,23 @@ discard block |
||
34 | 34 | |
35 | 35 | $merge_tags = array( |
36 | 36 | array( |
37 | - 'label' => __('Entry Creator: Display Name', 'gravityview'), |
|
37 | + 'label' => __( 'Entry Creator: Display Name', 'gravityview' ), |
|
38 | 38 | 'tag' => '{created_by:display_name}' |
39 | 39 | ), |
40 | 40 | array( |
41 | - 'label' => __('Entry Creator: Email', 'gravityview'), |
|
41 | + 'label' => __( 'Entry Creator: Email', 'gravityview' ), |
|
42 | 42 | 'tag' => '{created_by:user_email}' |
43 | 43 | ), |
44 | 44 | array( |
45 | - 'label' => __('Entry Creator: Username', 'gravityview'), |
|
45 | + 'label' => __( 'Entry Creator: Username', 'gravityview' ), |
|
46 | 46 | 'tag' => '{created_by:user_login}' |
47 | 47 | ), |
48 | 48 | array( |
49 | - 'label' => __('Entry Creator: User ID', 'gravityview'), |
|
49 | + 'label' => __( 'Entry Creator: User ID', 'gravityview' ), |
|
50 | 50 | 'tag' => '{created_by:ID}' |
51 | 51 | ), |
52 | 52 | array( |
53 | - 'label' => __('Entry Creator: Roles', 'gravityview'), |
|
53 | + 'label' => __( 'Entry Creator: Roles', 'gravityview' ), |
|
54 | 54 | 'tag' => '{created_by:roles}' |
55 | 55 | ), |
56 | 56 | ); |
@@ -78,19 +78,19 @@ discard block |
||
78 | 78 | public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
79 | 79 | |
80 | 80 | // If there are no matches OR the Entry `created_by` isn't set or is 0 (no user) |
81 | - if( empty( $entry['created_by'] ) ) { |
|
81 | + if ( empty( $entry[ 'created_by' ] ) ) { |
|
82 | 82 | return $text; |
83 | 83 | } |
84 | 84 | |
85 | 85 | // Get the creator of the entry |
86 | - $entry_creator = new WP_User( $entry['created_by'] ); |
|
86 | + $entry_creator = new WP_User( $entry[ 'created_by' ] ); |
|
87 | 87 | |
88 | 88 | foreach ( $matches as $match ) { |
89 | 89 | |
90 | - $full_tag = $match[0]; |
|
91 | - $property = $match[1]; |
|
90 | + $full_tag = $match[ 0 ]; |
|
91 | + $property = $match[ 1 ]; |
|
92 | 92 | |
93 | - switch( $property ) { |
|
93 | + switch ( $property ) { |
|
94 | 94 | /** @since 1.13.2 */ |
95 | 95 | case 'roles': |
96 | 96 | $value = implode( ', ', $entry_creator->roles ); |
@@ -113,18 +113,18 @@ discard block |
||
113 | 113 | |
114 | 114 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
115 | 115 | |
116 | - if( 'edit' === $context ) { |
|
116 | + if ( 'edit' === $context ) { |
|
117 | 117 | return $field_options; |
118 | 118 | } |
119 | 119 | |
120 | - $field_options['name_display'] = array( |
|
120 | + $field_options[ 'name_display' ] = array( |
|
121 | 121 | 'type' => 'select', |
122 | 122 | 'label' => __( 'User Format', 'gravityview' ), |
123 | - 'desc' => __( 'How should the User information be displayed?', 'gravityview'), |
|
123 | + 'desc' => __( 'How should the User information be displayed?', 'gravityview' ), |
|
124 | 124 | 'choices' => array( |
125 | - 'display_name' => __('Display Name (Example: "Ellen Ripley")', 'gravityview'), |
|
126 | - 'user_login' => __('Username (Example: "nostromo")', 'gravityview'), |
|
127 | - 'ID' => __('User ID # (Example: 426)', 'gravityview'), |
|
125 | + 'display_name' => __( 'Display Name (Example: "Ellen Ripley")', 'gravityview' ), |
|
126 | + 'user_login' => __( 'Username (Example: "nostromo")', 'gravityview' ), |
|
127 | + 'ID' => __( 'User ID # (Example: 426)', 'gravityview' ), |
|
128 | 128 | ), |
129 | 129 | 'value' => 'display_name' |
130 | 130 | ); |
@@ -57,21 +57,21 @@ discard block |
||
57 | 57 | public function dismiss_notice() { |
58 | 58 | |
59 | 59 | // No dismiss sent |
60 | - if( empty( $_GET['gv-dismiss'] ) ) { |
|
60 | + if ( empty( $_GET[ 'gv-dismiss' ] ) ) { |
|
61 | 61 | return; |
62 | 62 | } |
63 | 63 | |
64 | 64 | // Invalid nonce |
65 | - if( !wp_verify_nonce( $_GET['gv-dismiss'], 'dismiss' ) ) { |
|
65 | + if ( ! wp_verify_nonce( $_GET[ 'gv-dismiss' ], 'dismiss' ) ) { |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
69 | - $notice_id = esc_attr( $_GET['notice'] ); |
|
69 | + $notice_id = esc_attr( $_GET[ 'notice' ] ); |
|
70 | 70 | |
71 | 71 | //don't display a message if use has dismissed the message for this version |
72 | 72 | $dismissed_notices = (array)get_transient( 'gravityview_dismissed_notices' ); |
73 | 73 | |
74 | - $dismissed_notices[] = $notice_id; |
|
74 | + $dismissed_notices[ ] = $notice_id; |
|
75 | 75 | |
76 | 76 | $dismissed_notices = array_unique( $dismissed_notices ); |
77 | 77 | |
@@ -94,12 +94,12 @@ discard block |
||
94 | 94 | private function is_notice_dismissed( $notice ) { |
95 | 95 | |
96 | 96 | // There are no dismissed notices. |
97 | - if( empty( self::$dismissed_notices ) ) { |
|
97 | + if ( empty( self::$dismissed_notices ) ) { |
|
98 | 98 | return false; |
99 | 99 | } |
100 | 100 | |
101 | 101 | // Has the |
102 | - $is_dismissed = !empty( $notice['dismiss'] ) && in_array( $notice['dismiss'], self::$dismissed_notices ); |
|
102 | + $is_dismissed = ! empty( $notice[ 'dismiss' ] ) && in_array( $notice[ 'dismiss' ], self::$dismissed_notices ); |
|
103 | 103 | |
104 | 104 | return $is_dismissed ? true : false; |
105 | 105 | } |
@@ -124,17 +124,17 @@ discard block |
||
124 | 124 | */ |
125 | 125 | private function check_show_multisite_notices() { |
126 | 126 | |
127 | - if( ! is_multisite() ) { |
|
127 | + if ( ! is_multisite() ) { |
|
128 | 128 | return true; |
129 | 129 | } |
130 | 130 | |
131 | 131 | // It's network activated but the user can't manage network plugins; they can't do anything about it. |
132 | - if( GravityView_Plugin::is_network_activated() && ! is_main_site() ) { |
|
132 | + if ( GravityView_Plugin::is_network_activated() && ! is_main_site() ) { |
|
133 | 133 | return false; |
134 | 134 | } |
135 | 135 | |
136 | 136 | // or they don't have admin capabilities |
137 | - if( ! is_super_admin() ) { |
|
137 | + if ( ! is_super_admin() ) { |
|
138 | 138 | return false; |
139 | 139 | } |
140 | 140 | |
@@ -157,48 +157,48 @@ discard block |
||
157 | 157 | */ |
158 | 158 | $notices = apply_filters( 'gravityview/admin/notices', self::$admin_notices ); |
159 | 159 | |
160 | - if( empty( $notices ) || ! $this->check_show_multisite_notices() ) { |
|
160 | + if ( empty( $notices ) || ! $this->check_show_multisite_notices() ) { |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 | |
164 | 164 | //don't display a message if use has dismissed the message for this version |
165 | 165 | // TODO: Use get_user_meta instead of get_transient |
166 | - self::$dismissed_notices = isset( $_GET['show-dismissed-notices'] ) ? array() : (array)get_transient( 'gravityview_dismissed_notices' ); |
|
166 | + self::$dismissed_notices = isset( $_GET[ 'show-dismissed-notices' ] ) ? array() : (array)get_transient( 'gravityview_dismissed_notices' ); |
|
167 | 167 | |
168 | 168 | $output = ''; |
169 | 169 | |
170 | - foreach( $notices as $notice ) { |
|
170 | + foreach ( $notices as $notice ) { |
|
171 | 171 | |
172 | 172 | // If the user doesn't have the capability to see the warning |
173 | - if( isset( $notice['cap'] ) && false === GVCommon::has_cap( $notice['cap'] ) ) { |
|
173 | + if ( isset( $notice[ 'cap' ] ) && false === GVCommon::has_cap( $notice[ 'cap' ] ) ) { |
|
174 | 174 | do_action( 'gravityview_log_debug', 'Notice not shown because user does not have the capability to view it.', $notice ); |
175 | 175 | continue; |
176 | 176 | } |
177 | 177 | |
178 | - if( true === $this->is_notice_dismissed( $notice ) ) { |
|
178 | + if ( true === $this->is_notice_dismissed( $notice ) ) { |
|
179 | 179 | do_action( 'gravityview_log_debug', 'Notice not shown because the notice has already been dismissed.', $notice ); |
180 | 180 | continue; |
181 | 181 | } |
182 | 182 | |
183 | - $output .= '<div id="message" style="position:relative" class="notice '. gravityview_sanitize_html_class( $notice['class'] ).'">'; |
|
183 | + $output .= '<div id="message" style="position:relative" class="notice ' . gravityview_sanitize_html_class( $notice[ 'class' ] ) . '">'; |
|
184 | 184 | |
185 | 185 | // Too cute to leave out. |
186 | 186 | $output .= gravityview_get_floaty(); |
187 | 187 | |
188 | - if( !empty( $notice['title'] ) ) { |
|
189 | - $output .= '<h3>'.esc_html( $notice['title'] ) .'</h3>'; |
|
188 | + if ( ! empty( $notice[ 'title' ] ) ) { |
|
189 | + $output .= '<h3>' . esc_html( $notice[ 'title' ] ) . '</h3>'; |
|
190 | 190 | } |
191 | 191 | |
192 | - $message = isset( $notice['message'] ) ? $notice['message'] : ''; |
|
192 | + $message = isset( $notice[ 'message' ] ) ? $notice[ 'message' ] : ''; |
|
193 | 193 | |
194 | - if( !empty( $notice['dismiss'] ) ) { |
|
194 | + if ( ! empty( $notice[ 'dismiss' ] ) ) { |
|
195 | 195 | |
196 | - $dismiss = esc_attr($notice['dismiss']); |
|
196 | + $dismiss = esc_attr( $notice[ 'dismiss' ] ); |
|
197 | 197 | |
198 | 198 | $url = esc_url( add_query_arg( array( 'gv-dismiss' => wp_create_nonce( 'dismiss' ), 'notice' => $dismiss ) ) ); |
199 | 199 | |
200 | 200 | $align = is_rtl() ? 'alignleft' : 'alignright'; |
201 | - $message .= '<a href="'.$url.'" data-notice="'.$dismiss.'" class="' . $align . ' button button-link">'.esc_html__('Dismiss', 'gravityview' ).'</a></p>'; |
|
201 | + $message .= '<a href="' . $url . '" data-notice="' . $dismiss . '" class="' . $align . ' button button-link">' . esc_html__( 'Dismiss', 'gravityview' ) . '</a></p>'; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | $output .= wpautop( $message ); |
@@ -225,14 +225,14 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public static function add_notice( $notice = array() ) { |
227 | 227 | |
228 | - if( !isset( $notice['message'] ) ) { |
|
228 | + if ( ! isset( $notice[ 'message' ] ) ) { |
|
229 | 229 | do_action( 'gravityview_log_error', 'GravityView_Admin[add_notice] Notice not set', $notice ); |
230 | 230 | return; |
231 | 231 | } |
232 | 232 | |
233 | - $notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class']; |
|
233 | + $notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ]; |
|
234 | 234 | |
235 | - self::$admin_notices[] = $notice; |
|
235 | + self::$admin_notices[ ] = $notice; |
|
236 | 236 | } |
237 | 237 | } |
238 | 238 |
@@ -22,27 +22,27 @@ |
||
22 | 22 | |
23 | 23 | <?php // list all the available templates (type= fresh or custom ) ?> |
24 | 24 | <div class="gv-grid"> |
25 | - <?php foreach( $templates as $id => $template ) { |
|
25 | + <?php foreach ( $templates as $id => $template ) { |
|
26 | 26 | $selected = ( $id == $current_template ) ? ' gv-selected' : ''; ?> |
27 | 27 | |
28 | 28 | <div class="gv-grid-col-1-3"> |
29 | - <div class="gv-view-types-module<?php echo $selected; ?>" data-filter="<?php echo esc_attr( $template['type'] ); ?>"> |
|
29 | + <div class="gv-view-types-module<?php echo $selected; ?>" data-filter="<?php echo esc_attr( $template[ 'type' ] ); ?>"> |
|
30 | 30 | <div class="gv-view-types-hover"> |
31 | 31 | <div> |
32 | - <?php if( !empty( $template['buy_source'] ) ) { ?> |
|
33 | - <p><a href="<?php echo esc_url( $template['buy_source'] ); ?>" class="button-primary button-buy-now"><?php esc_html_e( 'Buy Now', 'gravityview'); ?></a></p> |
|
32 | + <?php if ( ! empty( $template[ 'buy_source' ] ) ) { ?> |
|
33 | + <p><a href="<?php echo esc_url( $template[ 'buy_source' ] ); ?>" class="button-primary button-buy-now"><?php esc_html_e( 'Buy Now', 'gravityview' ); ?></a></p> |
|
34 | 34 | <?php } else { ?> |
35 | - <p><a href="#gv_select_template" class="button button-large button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview'); ?></a></p> |
|
36 | - <?php if( !empty( $template['preview'] ) ) { ?> |
|
37 | - <a href="<?php echo esc_url( $template['preview'] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-admin-links" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview'); ?>"></i></a> |
|
35 | + <p><a href="#gv_select_template" class="button button-large button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview' ); ?></a></p> |
|
36 | + <?php if ( ! empty( $template[ 'preview' ] ) ) { ?> |
|
37 | + <a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-admin-links" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview' ); ?>"></i></a> |
|
38 | 38 | <?php } ?> |
39 | 39 | <?php } ?> |
40 | 40 | </div> |
41 | 41 | </div> |
42 | 42 | <div class="gv-view-types-normal"> |
43 | - <img src="<?php echo esc_url( $template['logo'] ); ?>" alt="<?php echo esc_attr( $template['label'] ); ?>"> |
|
44 | - <h5><?php echo esc_attr( $template['label'] ); ?></h5> |
|
45 | - <p class="description"><?php echo esc_attr( $template['description'] ); ?></p> |
|
43 | + <img src="<?php echo esc_url( $template[ 'logo' ] ); ?>" alt="<?php echo esc_attr( $template[ 'label' ] ); ?>"> |
|
44 | + <h5><?php echo esc_attr( $template[ 'label' ] ); ?></h5> |
|
45 | + <p class="description"><?php echo esc_attr( $template[ 'description' ] ); ?></p> |
|
46 | 46 | </div> |
47 | 47 | </div> |
48 | 48 | </div> |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | GravityView_Render_Settings::render_setting_row( 'sort_columns', $current_settings ); |
28 | 28 | |
29 | - $sort_fields_input = '<select name="template_settings[sort_field]" id="gravityview_sort_field">'.gravityview_get_sortable_fields( $curr_form, $current_settings['sort_field'] ).'</select>'; |
|
29 | + $sort_fields_input = '<select name="template_settings[sort_field]" id="gravityview_sort_field">' . gravityview_get_sortable_fields( $curr_form, $current_settings[ 'sort_field' ] ) . '</select>'; |
|
30 | 30 | |
31 | 31 | GravityView_Render_Settings::render_setting_row( 'sort_field', $current_settings, $sort_fields_input ); |
32 | 32 |
@@ -14,8 +14,8 @@ |
||
14 | 14 | <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"> |
15 | 15 | <?php |
16 | 16 | |
17 | - foreach( $metaboxes as $metabox ) { |
|
18 | - $class = !isset( $class ) ? 'nav-tab-active' : ''; |
|
17 | + foreach ( $metaboxes as $metabox ) { |
|
18 | + $class = ! isset( $class ) ? 'nav-tab-active' : ''; |
|
19 | 19 | ?> |
20 | 20 | <li class="ui-state-default"> |
21 | 21 | <a class="nav-tab ui-tabs-anchor <?php echo $class; ?>" href="#<?php echo esc_attr( $metabox->id ); ?>"> |
@@ -19,9 +19,9 @@ |
||
19 | 19 | * Loop through the array of registered metaboxes |
20 | 20 | * @var GravityView_Metabox_Tab $metabox |
21 | 21 | */ |
22 | - foreach( $metaboxes as $metabox ) { |
|
22 | + foreach ( $metaboxes as $metabox ) { |
|
23 | 23 | |
24 | - echo '<div id="'.esc_attr( $metabox->id ).'">'; |
|
24 | + echo '<div id="' . esc_attr( $metabox->id ) . '">'; |
|
25 | 25 | |
26 | 26 | $metabox->render( $post ); |
27 | 27 |
@@ -10,33 +10,33 @@ discard block |
||
10 | 10 | |
11 | 11 | <div id="directory-fields" class="gv-section"> |
12 | 12 | |
13 | - <h4><?php esc_html_e( 'Above Entries Widgets', 'gravityview'); ?> <span><?php esc_html_e( 'These widgets will be shown above entries.', 'gravityview'); ?></span></h4> |
|
13 | + <h4><?php esc_html_e( 'Above Entries Widgets', 'gravityview' ); ?> <span><?php esc_html_e( 'These widgets will be shown above entries.', 'gravityview' ); ?></span></h4> |
|
14 | 14 | |
15 | - <?php do_action('gravityview_render_widgets_active_areas', $curr_template, 'header', $post->ID ); ?> |
|
15 | + <?php do_action( 'gravityview_render_widgets_active_areas', $curr_template, 'header', $post->ID ); ?> |
|
16 | 16 | |
17 | - <h4><?php esc_html_e( 'Entries Fields', 'gravityview'); ?> <span><?php esc_html_e( 'These fields will be shown for each entry.', 'gravityview'); ?></span></h4> |
|
17 | + <h4><?php esc_html_e( 'Entries Fields', 'gravityview' ); ?> <span><?php esc_html_e( 'These fields will be shown for each entry.', 'gravityview' ); ?></span></h4> |
|
18 | 18 | |
19 | 19 | <div id="directory-active-fields" class="gv-grid gv-grid-pad gv-grid-border"> |
20 | - <?php if(!empty( $curr_template ) ) { |
|
21 | - do_action('gravityview_render_directory_active_areas', $curr_template, 'directory', $post->ID, true ); |
|
20 | + <?php if ( ! empty( $curr_template ) ) { |
|
21 | + do_action( 'gravityview_render_directory_active_areas', $curr_template, 'directory', $post->ID, true ); |
|
22 | 22 | } ?> |
23 | 23 | </div> |
24 | 24 | |
25 | - <h4><?php esc_html_e( 'Below Entries Widgets', 'gravityview'); ?> <span><?php esc_html_e( 'These widgets will be shown below entries.', 'gravityview'); ?></span></h4> |
|
25 | + <h4><?php esc_html_e( 'Below Entries Widgets', 'gravityview' ); ?> <span><?php esc_html_e( 'These widgets will be shown below entries.', 'gravityview' ); ?></span></h4> |
|
26 | 26 | |
27 | - <?php do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); ?> |
|
27 | + <?php do_action( 'gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); ?> |
|
28 | 28 | |
29 | 29 | |
30 | 30 | <?php // list of available fields to be shown in the popup ?> |
31 | 31 | <div id="directory-available-fields" class="hide-if-js gv-tooltip"> |
32 | 32 | <span class="close"><i class="dashicons dashicons-dismiss"></i></span> |
33 | - <?php do_action('gravityview_render_available_fields', $curr_form, 'directory' ); ?> |
|
33 | + <?php do_action( 'gravityview_render_available_fields', $curr_form, 'directory' ); ?> |
|
34 | 34 | </div> |
35 | 35 | |
36 | 36 | <?php // list of available widgets to be shown in the popup ?> |
37 | 37 | <div id="directory-available-widgets" class="hide-if-js gv-tooltip"> |
38 | 38 | <span class="close"><i class="dashicons dashicons-dismiss"></i></span> |
39 | - <?php do_action('gravityview_render_available_widgets' ); ?> |
|
39 | + <?php do_action( 'gravityview_render_available_widgets' ); ?> |
|
40 | 40 | </div> |
41 | 41 | |
42 | 42 | </div> |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | |
53 | 53 | <div id="single-fields" class="gv-section"> |
54 | 54 | |
55 | - <h4><?php esc_html_e( 'These fields will be shown in Single Entry view.', 'gravityview'); ?></h4> |
|
55 | + <h4><?php esc_html_e( 'These fields will be shown in Single Entry view.', 'gravityview' ); ?></h4> |
|
56 | 56 | |
57 | 57 | <div id="single-active-fields" class="gv-grid gv-grid-pad gv-grid-border"> |
58 | - <?php if(!empty( $curr_template ) ) { |
|
59 | - do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
58 | + <?php if ( ! empty( $curr_template ) ) { |
|
59 | + do_action( 'gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
60 | 60 | } ?> |
61 | 61 | </div> |
62 | 62 | |
63 | 63 | <div id="single-available-fields" class="hide-if-js gv-tooltip"> |
64 | 64 | <span class="close"><i class="dashicons dashicons-dismiss"></i></span> |
65 | - <?php do_action('gravityview_render_available_fields', $curr_form, 'single' ); ?> |
|
65 | + <?php do_action( 'gravityview_render_available_fields', $curr_form, 'single' ); ?> |
|
66 | 66 | </div> |
67 | 67 | |
68 | 68 | </div> |
@@ -73,17 +73,17 @@ discard block |
||
73 | 73 | |
74 | 74 | <div id="edit-fields" class="gv-section"> |
75 | 75 | |
76 | - <h4><?php esc_html_e( 'Fields shown when editing an entry.', 'gravityview'); ?> <span><?php esc_html_e('If not configured, all form fields will be displayed.', 'gravityview'); ?></span></h4> |
|
76 | + <h4><?php esc_html_e( 'Fields shown when editing an entry.', 'gravityview' ); ?> <span><?php esc_html_e( 'If not configured, all form fields will be displayed.', 'gravityview' ); ?></span></h4> |
|
77 | 77 | |
78 | 78 | <div id="edit-active-fields" class="gv-grid gv-grid-pad gv-grid-border"> |
79 | 79 | <?php |
80 | - do_action('gravityview_render_directory_active_areas', apply_filters( 'gravityview/template/edit', 'default_table_edit' ), 'edit', $post->ID, true ); |
|
80 | + do_action( 'gravityview_render_directory_active_areas', apply_filters( 'gravityview/template/edit', 'default_table_edit' ), 'edit', $post->ID, true ); |
|
81 | 81 | ?> |
82 | 82 | </div> |
83 | 83 | |
84 | 84 | <div id="edit-available-fields" class="hide-if-js gv-tooltip"> |
85 | 85 | <span class="close"><i class="dashicons dashicons-dismiss"></i></span> |
86 | - <?php do_action('gravityview_render_available_fields', $curr_form, 'edit' ); ?> |
|
86 | + <?php do_action( 'gravityview_render_available_fields', $curr_form, 'edit' ); ?> |
|
87 | 87 | </div> |
88 | 88 | |
89 | 89 | </div> |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | * @param array $callback_args Arguments passed to the callback |
98 | 98 | * @return void |
99 | 99 | */ |
100 | - function __construct( $id, $title = '', $file = '', $icon_class_name = '', $callback = '', $callback_args = array() ) { |
|
100 | + function __construct( $id, $title = '', $file = '', $icon_class_name = '', $callback = '', $callback_args = array() ) { |
|
101 | 101 | |
102 | - $this->id = $this->prefix.$id; |
|
102 | + $this->id = $this->prefix . $id; |
|
103 | 103 | $this->title = $title; |
104 | 104 | $this->render_template_file = $file; |
105 | 105 | $this->callback = $callback; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | function parse_icon_class_name( $icon_class_name = '' ) { |
120 | 120 | |
121 | - if( preg_match( '/dashicon/i', $icon_class_name ) ) { |
|
121 | + if ( preg_match( '/dashicon/i', $icon_class_name ) ) { |
|
122 | 122 | $icon_class_name = 'dashicons ' . $icon_class_name; |
123 | 123 | } |
124 | 124 | |
@@ -142,29 +142,29 @@ discard block |
||
142 | 142 | */ |
143 | 143 | function render( $post ) { |
144 | 144 | |
145 | - if( !empty( $this->render_template_file ) ) { |
|
145 | + if ( ! empty( $this->render_template_file ) ) { |
|
146 | 146 | |
147 | 147 | $file = $this->render_template_file; |
148 | 148 | |
149 | 149 | // If the full path exists, use it |
150 | - if( file_exists( $file ) ) { |
|
150 | + if ( file_exists( $file ) ) { |
|
151 | 151 | $path = $file; |
152 | 152 | } else { |
153 | - $path = GRAVITYVIEW_DIR .'includes/admin/metaboxes/views/'.$file; |
|
153 | + $path = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/views/' . $file; |
|
154 | 154 | } |
155 | 155 | |
156 | - if( file_exists( $path ) ) { |
|
156 | + if ( file_exists( $path ) ) { |
|
157 | 157 | include $path; |
158 | 158 | } else { |
159 | 159 | do_action( 'gravityview_log_error', 'Metabox template file not found', $this ); |
160 | 160 | } |
161 | 161 | |
162 | - } else if( !empty( $this->callback ) ) { |
|
162 | + } else if ( ! empty( $this->callback ) ) { |
|
163 | 163 | |
164 | - if( is_callable( $this->callback ) ) { |
|
164 | + if ( is_callable( $this->callback ) ) { |
|
165 | 165 | |
166 | 166 | /** @see do_accordion_sections() */ |
167 | - call_user_func( $this->callback, $post, (array) $this ); |
|
167 | + call_user_func( $this->callback, $post, (array)$this ); |
|
168 | 168 | |
169 | 169 | } else { |
170 | 170 | do_action( 'gravityview_log_error', 'Metabox callback was not callable', $this ); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function __construct() { |
19 | 19 | |
20 | - if( !GravityView_Compatibility::is_valid() ) { return; } |
|
20 | + if ( ! GravityView_Compatibility::is_valid() ) { return; } |
|
21 | 21 | |
22 | 22 | self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/'; |
23 | 23 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function initialize() { |
37 | 37 | |
38 | - add_action( 'add_meta_boxes', array( $this, 'register_metaboxes' )); |
|
38 | + add_action( 'add_meta_boxes', array( $this, 'register_metaboxes' ) ); |
|
39 | 39 | |
40 | - add_action( 'add_meta_boxes_gravityview' , array( $this, 'update_priority' ) ); |
|
40 | + add_action( 'add_meta_boxes_gravityview', array( $this, 'update_priority' ) ); |
|
41 | 41 | |
42 | 42 | // information box |
43 | 43 | add_action( 'post_submitbox_misc_actions', array( $this, 'render_shortcode_hint' ) ); |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | function update_priority() { |
52 | 52 | global $wp_meta_boxes; |
53 | 53 | |
54 | - if( ! empty( $wp_meta_boxes['gravityview'] ) ) { |
|
55 | - foreach( array( 'high', 'core', 'low' ) as $position ) { |
|
56 | - if( isset( $wp_meta_boxes['gravityview']['normal'][ $position ] ) ) { |
|
57 | - foreach( $wp_meta_boxes['gravityview']['normal'][ $position ] as $key => $meta_box ) { |
|
58 | - if( ! preg_match( '/^gravityview_/ism', $key ) ) { |
|
59 | - $wp_meta_boxes['gravityview']['advanced'][ $position ][ $key ] = $meta_box; |
|
60 | - unset( $wp_meta_boxes['gravityview']['normal'][ $position ][ $key ] ); |
|
54 | + if ( ! empty( $wp_meta_boxes[ 'gravityview' ] ) ) { |
|
55 | + foreach ( array( 'high', 'core', 'low' ) as $position ) { |
|
56 | + if ( isset( $wp_meta_boxes[ 'gravityview' ][ 'normal' ][ $position ] ) ) { |
|
57 | + foreach ( $wp_meta_boxes[ 'gravityview' ][ 'normal' ][ $position ] as $key => $meta_box ) { |
|
58 | + if ( ! preg_match( '/^gravityview_/ism', $key ) ) { |
|
59 | + $wp_meta_boxes[ 'gravityview' ][ 'advanced' ][ $position ][ $key ] = $meta_box; |
|
60 | + unset( $wp_meta_boxes[ 'gravityview' ][ 'normal' ][ $position ][ $key ] ); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | global $post; |
70 | 70 | |
71 | 71 | // On Comment Edit, for example, $post isn't set. |
72 | - if( empty( $post ) || !is_object( $post ) || !isset( $post->ID ) ) { |
|
72 | + if ( empty( $post ) || ! is_object( $post ) || ! isset( $post->ID ) ) { |
|
73 | 73 | return; |
74 | 74 | } |
75 | 75 | |
@@ -152,9 +152,9 @@ discard block |
||
152 | 152 | */ |
153 | 153 | $metaboxes = apply_filters( 'gravityview/metaboxes/default', $metaboxes ); |
154 | 154 | |
155 | - foreach( $metaboxes as $m ) { |
|
155 | + foreach ( $metaboxes as $m ) { |
|
156 | 156 | |
157 | - $tab = new GravityView_Metabox_Tab( $m['id'], $m['title'], $m['file'], $m['icon-class'], $m['callback'], $m['callback_args'] ); |
|
157 | + $tab = new GravityView_Metabox_Tab( $m[ 'id' ], $m[ 'title' ], $m[ 'file' ], $m[ 'icon-class' ], $m[ 'callback' ], $m[ 'callback_args' ] ); |
|
158 | 158 | |
159 | 159 | GravityView_Metabox_Tabs::add( $tab ); |
160 | 160 | |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | |
181 | 181 | $links = GravityView_Admin_Views::get_connected_form_links( $current_form, false ); |
182 | 182 | |
183 | - if( !empty( $links ) ) { |
|
184 | - $links = '<span class="alignright gv-form-links">'. $links .'</span>'; |
|
183 | + if ( ! empty( $links ) ) { |
|
184 | + $links = '<span class="alignright gv-form-links">' . $links . '</span>'; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | return __( 'Data Source', 'gravityview' ) . $links; |
@@ -220,28 +220,28 @@ discard block |
||
220 | 220 | */ |
221 | 221 | public static function render_merge_tags_scripts( $curr_form ) { |
222 | 222 | |
223 | - if( empty( $curr_form )) { |
|
223 | + if ( empty( $curr_form ) ) { |
|
224 | 224 | return NULL; |
225 | 225 | } |
226 | 226 | |
227 | 227 | $form = gravityview_get_form( $curr_form ); |
228 | 228 | |
229 | - $get_id_backup = isset($_GET['id']) ? $_GET['id'] : NULL; |
|
229 | + $get_id_backup = isset( $_GET[ 'id' ] ) ? $_GET[ 'id' ] : NULL; |
|
230 | 230 | |
231 | - if( isset( $form['id'] ) ) { |
|
232 | - $form_script = 'var form = ' . GFCommon::json_encode($form) . ';'; |
|
231 | + if ( isset( $form[ 'id' ] ) ) { |
|
232 | + $form_script = 'var form = ' . GFCommon::json_encode( $form ) . ';'; |
|
233 | 233 | |
234 | 234 | // The `gf_vars()` method needs a $_GET[id] variable set with the form ID. |
235 | - $_GET['id'] = $form['id']; |
|
235 | + $_GET[ 'id' ] = $form[ 'id' ]; |
|
236 | 236 | |
237 | 237 | } else { |
238 | 238 | $form_script = 'var form = new Form();'; |
239 | 239 | } |
240 | 240 | |
241 | - $output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars(false) . '</script>'; |
|
241 | + $output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars( false ) . '</script>'; |
|
242 | 242 | |
243 | 243 | // Restore previous $_GET setting |
244 | - $_GET['id'] = $get_id_backup; |
|
244 | + $_GET[ 'id' ] = $get_id_backup; |
|
245 | 245 | |
246 | 246 | return $output; |
247 | 247 | } |
@@ -297,10 +297,10 @@ discard block |
||
297 | 297 | global $post; |
298 | 298 | |
299 | 299 | // Only show this on GravityView post types. |
300 | - if( false === gravityview_is_admin_page() ) { return; } |
|
300 | + if ( false === gravityview_is_admin_page() ) { return; } |
|
301 | 301 | |
302 | 302 | // If the View hasn't been configured yet, don't show embed shortcode |
303 | - if( !gravityview_get_directory_fields( $post->ID ) ) { return; } |
|
303 | + if ( ! gravityview_get_directory_fields( $post->ID ) ) { return; } |
|
304 | 304 | |
305 | 305 | include self::$metaboxes_dir . 'views/shortcode-hint.php'; |
306 | 306 | } |