@@ -12,7 +12,9 @@ |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // Exit if accessed directly |
15 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
15 | +if ( ! defined( 'ABSPATH' ) ) { |
|
16 | + exit; |
|
17 | +} |
|
16 | 18 | |
17 | 19 | /** |
18 | 20 | * GravityView_Welcome Class |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | public function __construct() { |
36 | 36 | add_action( 'gk/foundation/initialized', array( $this, 'admin_menus' ) ); |
37 | 37 | add_action( 'admin_head', array( $this, 'admin_head' ) ); |
38 | - add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
39 | - add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page'), 10, 2 ); |
|
38 | + add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
39 | + add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page' ), 10, 2 ); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | public function is_dashboard_page( $is_page = false, $hook = NULL ) { |
93 | 93 | global $pagenow; |
94 | 94 | |
95 | - if ( empty( $_GET['page'] ) ) { |
|
95 | + if ( empty( $_GET[ 'page' ] ) ) { |
|
96 | 96 | return $is_page; |
97 | 97 | } |
98 | 98 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | return $is_page; |
101 | 101 | } |
102 | 102 | |
103 | - return 'admin.php' === $pagenow && in_array( $_GET['page'], array( 'gv-changelog', 'gv-credits', 'gv-getting-started' ), true ); |
|
103 | + return 'admin.php' === $pagenow && in_array( $_GET[ 'page' ], array( 'gv-changelog', 'gv-credits', 'gv-getting-started' ), true ); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $admin_menu::remove_submenu_item( 'gv-credits' ); |
117 | 117 | $admin_menu::remove_submenu_item( 'gv-changelog' ); |
118 | 118 | |
119 | - if( ! $this->is_dashboard_page() ) { |
|
119 | + if ( ! $this->is_dashboard_page() ) { |
|
120 | 120 | return; |
121 | 121 | } |
122 | 122 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | // Don't fetch -beta, etc. |
142 | 142 | list( $display_version ) = explode( '-', GravityView_Plugin::version ); |
143 | 143 | |
144 | - $selected = !empty( $plugin_page ) ? $plugin_page : 'gv-getting-started'; |
|
144 | + $selected = ! empty( $plugin_page ) ? $plugin_page : 'gv-getting-started'; |
|
145 | 145 | |
146 | 146 | echo gravityview_get_floaty( 132 ); |
147 | 147 | ?> |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | <h3>Create a View</h3> |
191 | 191 | |
192 | 192 | <ol class="ol-decimal"> |
193 | - <li>Go to the GravityKit menu and click on <a href="<?php echo admin_url('post-new.php?post_type=gravityview'); ?>">New View</a></li> |
|
193 | + <li>Go to the GravityKit menu and click on <a href="<?php echo admin_url( 'post-new.php?post_type=gravityview' ); ?>">New View</a></li> |
|
194 | 194 | <li>If you want to <strong>create a new form</strong>, click the "Use a Form Preset" button</li> |
195 | 195 | <li>If you want to <strong>use an existing form’s entries</strong>, select from the dropdown.</li> |
196 | 196 | <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>. |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | </ul> |
701 | 701 | |
702 | 702 | <h3><?php esc_attr_e( 'Want to contribute?', 'gk-gravityview' ); ?></h3> |
703 | - <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.', 'gk-gravityview'), '<a href="https://github.com/gravityview/GravityView">', '</a>' ); ?></p> |
|
703 | + <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.', 'gk-gravityview' ), '<a href="https://github.com/gravityview/GravityView">', '</a>' ); ?></p> |
|
704 | 704 | </div> |
705 | 705 | |
706 | 706 | <hr class="clear" /> |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | global $plugin_page; |
742 | 742 | |
743 | 743 | // Bail if we're just editing the plugin |
744 | - if( $plugin_page === 'plugin-editor.php' ) { return; } |
|
744 | + if ( $plugin_page === 'plugin-editor.php' ) { return; } |
|
745 | 745 | |
746 | 746 | // Bail if no activation redirect |
747 | 747 | if ( ! get_transient( '_gv_activation_redirect' ) ) { return; } |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | $upgrade = get_option( 'gv_version_upgraded_from' ); |
753 | 753 | |
754 | 754 | // Don't do anything if they've already seen the new version info |
755 | - if( $upgrade === GravityView_Plugin::version ) { |
|
755 | + if ( $upgrade === GravityView_Plugin::version ) { |
|
756 | 756 | return; |
757 | 757 | } |
758 | 758 | |
@@ -760,10 +760,10 @@ discard block |
||
760 | 760 | update_option( 'gv_version_upgraded_from', GravityView_Plugin::version ); |
761 | 761 | |
762 | 762 | // Bail if activating from network, or bulk |
763 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; } |
|
763 | + if ( is_network_admin() || isset( $_GET[ 'activate-multi' ] ) ) { return; } |
|
764 | 764 | |
765 | 765 | // First time install |
766 | - if( ! $upgrade ) { |
|
766 | + if ( ! $upgrade ) { |
|
767 | 767 | wp_safe_redirect( admin_url( 'admin.php?page=gv-getting-started' ) ); exit; |
768 | 768 | } |
769 | 769 | // Update |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | * @return string Path to XML file |
194 | 194 | */ |
195 | 195 | public function assign_form_xml( $xml = '', $template = '' ) { |
196 | - if ( $this->settings['type'] === 'preset' && ! empty( $this->settings['preset_form'] ) && $this->template_id === $template ) { |
|
197 | - return $this->settings['preset_form']; |
|
196 | + if ( $this->settings[ 'type' ] === 'preset' && ! empty( $this->settings[ 'preset_form' ] ) && $this->template_id === $template ) { |
|
197 | + return $this->settings[ 'preset_form' ]; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | return $xml; |
@@ -207,8 +207,8 @@ discard block |
||
207 | 207 | * @return string Path to XML file |
208 | 208 | */ |
209 | 209 | public function assign_fields_xml( $xml = '', $template = '' ) { |
210 | - if ( $this->settings['type'] === 'preset' && ! empty( $this->settings['preset_fields'] ) && $this->template_id === $template ) { |
|
211 | - return $this->settings['preset_fields']; |
|
210 | + if ( $this->settings[ 'type' ] === 'preset' && ! empty( $this->settings[ 'preset_fields' ] ) && $this->template_id === $template ) { |
|
211 | + return $this->settings[ 'preset_fields' ]; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | return $xml; |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function assign_view_slug( $default, $context ) { |
228 | 228 | |
229 | - if ( ! empty( $this->settings['slug'] ) ) { |
|
230 | - return $this->settings['slug']; |
|
229 | + if ( ! empty( $this->settings[ 'slug' ] ) ) { |
|
230 | + return $this->settings[ 'slug' ]; |
|
231 | 231 | } |
232 | 232 | if ( ! empty( $default ) ) { |
233 | 233 | return $default; |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | * @return void |
245 | 245 | */ |
246 | 246 | public function register_styles() { |
247 | - if ( ! empty( $this->settings['css_source'] ) ) { |
|
248 | - wp_register_style( 'gravityview_style_' . $this->template_id, $this->settings['css_source'], array(), GravityView_Plugin::version, 'all' ); |
|
247 | + if ( ! empty( $this->settings[ 'css_source' ] ) ) { |
|
248 | + wp_register_style( 'gravityview_style_' . $this->template_id, $this->settings[ 'css_source' ], array(), GravityView_Plugin::version, 'all' ); |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 |
@@ -5,4 +5,4 @@ |
||
5 | 5 | * @deprecated 1.7.5 |
6 | 6 | */ |
7 | 7 | |
8 | -include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' ); |
|
8 | +include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' ); |
@@ -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,12 +10,12 @@ |
||
10 | 10 | |
11 | 11 | function render_input( $override_input = null ) { |
12 | 12 | |
13 | - if( isset( $override_input ) ) { |
|
13 | + if ( isset( $override_input ) ) { |
|
14 | 14 | echo $override_input; |
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
18 | - $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat'; |
|
18 | + $class = ! empty( $this->field[ 'class' ] ) ? $this->field[ 'class' ] : 'widefat'; |
|
19 | 19 | |
20 | 20 | ?> |
21 | 21 | <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>" /> |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | function render_setting( $override_input = NULL ) { |
17 | 17 | |
18 | - if( $this->get_field_left_label() ) { ?> |
|
18 | + if ( $this->get_field_left_label() ) { ?> |
|
19 | 19 | |
20 | 20 | <td scope="row"> |
21 | 21 | <label for="<?php echo $this->get_field_id(); ?>"> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | function render_input( $override_input = NULL ) { |
45 | - if( isset( $override_input ) ) { |
|
45 | + if ( isset( $override_input ) ) { |
|
46 | 46 | echo $override_input; |
47 | 47 | return; |
48 | 48 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | ?> |
9 | 9 | <label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php |
10 | 10 | |
11 | - echo '<span class="gv-label">'.$this->get_field_label().'</span>'; |
|
11 | + echo '<span class="gv-label">' . $this->get_field_label() . '</span>'; |
|
12 | 12 | |
13 | 13 | echo $this->get_tooltip() . $this->get_field_desc(); |
14 | 14 | |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | function render_input( $override_input = null ) { |
23 | - if( isset( $override_input ) ) { |
|
23 | + if ( isset( $override_input ) ) { |
|
24 | 24 | echo $override_input; |
25 | 25 | return; |
26 | 26 | } |
27 | 27 | ?> |
28 | 28 | <select name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>"> |
29 | - <?php foreach( $this->field['options'] as $value => $label ) : ?> |
|
29 | + <?php foreach ( $this->field[ 'options' ] as $value => $label ) : ?> |
|
30 | 30 | <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $this->value, true ); ?>><?php echo esc_html( $label ); ?></option> |
31 | 31 | <?php endforeach; ?> |
32 | 32 | </select> |
@@ -7,4 +7,4 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $search_field = $gravityview_view->search_field; |
10 | -?><div><input type="hidden" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>"></div> |
|
11 | 10 | \ No newline at end of file |
11 | +?><div><input type="hidden" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>"></div> |
|
12 | 12 | \ No newline at end of file |