@@ -20,16 +20,16 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | function gravityview_register_gravityview_widgets() { |
| 22 | 22 | |
| 23 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' ); |
|
| 23 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' ); |
|
| 24 | 24 | |
| 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 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-page-size.php' ); |
|
| 28 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-custom-content.php' ); |
|
| 29 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/search-widget/class-search-widget.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 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-page-size.php' ); |
|
| 28 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-custom-content.php' ); |
|
| 29 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/search-widget/class-search-widget.php' ); |
|
| 30 | 30 | |
| 31 | - if( class_exists('GFPolls') ) { |
|
| 32 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/poll/class-gravityview-widget-poll.php' ); |
|
| 31 | + if ( class_exists( 'GFPolls' ) ) { |
|
| 32 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/poll/class-gravityview-widget-poll.php' ); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | } |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | $gv_page = gravityview()->request->is_admin( '', 'single' ); |
| 79 | 79 | |
| 80 | 80 | // New View or Edit View page |
| 81 | - if( $gv_page && $pagenow === 'post-new.php' ) { |
|
| 81 | + if ( $gv_page && $pagenow === 'post-new.php' ) { |
|
| 82 | 82 | remove_meta_box( 'woothemes-settings', 'gravityview', 'normal' ); |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | parent::add_hooks(); |
| 69 | 69 | |
| 70 | - if( gravityview()->request->is_admin( '', null ) ) { |
|
| 70 | + if ( gravityview()->request->is_admin( '', null ) ) { |
|
| 71 | 71 | |
| 72 | 72 | // Make Yoast metabox go down to the bottom please. |
| 73 | 73 | add_filter( 'wpseo_metabox_prio', array( $this, 'return_low' ) ); |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function disable_content_analysis( $options ) { |
| 94 | 94 | |
| 95 | - $options['keyword_analysis_active'] = false; |
|
| 96 | - $options['content_analysis_active'] = false; |
|
| 95 | + $options[ 'keyword_analysis_active' ] = false; |
|
| 96 | + $options[ 'content_analysis_active' ] = false; |
|
| 97 | 97 | |
| 98 | 98 | return $options; |
| 99 | 99 | } |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | global $pagenow; |
| 113 | 113 | |
| 114 | 114 | // New View page |
| 115 | - if( $pagenow === 'post-new.php' ) { |
|
| 116 | - $options['hideeditbox-gravityview'] = true; |
|
| 115 | + if ( $pagenow === 'post-new.php' ) { |
|
| 116 | + $options[ 'hideeditbox-gravityview' ] = true; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | return $options; |
@@ -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 | } |
@@ -299,12 +299,12 @@ discard block |
||
| 299 | 299 | global $post; |
| 300 | 300 | |
| 301 | 301 | // Only show this on GravityView post types. |
| 302 | - if( false === gravityview()->request->is_admin( '', null ) ) { |
|
| 302 | + if ( false === gravityview()->request->is_admin( '', null ) ) { |
|
| 303 | 303 | return; |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | // If the View hasn't been configured yet, don't show embed shortcode |
| 307 | - if( ! gravityview_get_directory_fields( $post->ID ) && ! gravityview_get_directory_widgets( $post->ID ) ) { |
|
| 307 | + if ( ! gravityview_get_directory_fields( $post->ID ) && ! gravityview_get_directory_widgets( $post->ID ) ) { |
|
| 308 | 308 | return; |
| 309 | 309 | } |
| 310 | 310 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public function __construct() { |
| 20 | 20 | |
| 21 | - if( ! is_admin() ) { return; } |
|
| 21 | + if ( ! is_admin() ) { return; } |
|
| 22 | 22 | |
| 23 | 23 | $this->add_hooks(); |
| 24 | 24 | } |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | private function add_hooks() { |
| 34 | 34 | //Hooks for no-conflict functionality |
| 35 | - add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000); |
|
| 36 | - add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9); |
|
| 35 | + add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000 ); |
|
| 36 | + add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9 ); |
|
| 37 | 37 | |
| 38 | - add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000); |
|
| 39 | - add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11); |
|
| 40 | - add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1); |
|
| 41 | - add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1); |
|
| 38 | + add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000 ); |
|
| 39 | + add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11 ); |
|
| 40 | + add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1 ); |
|
| 41 | + add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1 ); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | function no_conflict_scripts() { |
| 52 | 52 | global $wp_scripts; |
| 53 | 53 | |
| 54 | - if( ! gravityview()->request->is_admin( '', null ) ) { |
|
| 54 | + if ( ! gravityview()->request->is_admin( '', null ) ) { |
|
| 55 | 55 | return; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $no_conflict_mode = gravityview()->plugin->settings->get( 'no-conflict-mode' ); |
| 59 | 59 | |
| 60 | - if( empty( $no_conflict_mode ) ) { |
|
| 60 | + if ( empty( $no_conflict_mode ) ) { |
|
| 61 | 61 | return; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -110,15 +110,15 @@ discard block |
||
| 110 | 110 | function no_conflict_styles() { |
| 111 | 111 | global $wp_styles; |
| 112 | 112 | |
| 113 | - if( ! gravityview()->request->is_admin( '', null ) ) { |
|
| 113 | + if ( ! gravityview()->request->is_admin( '', null ) ) { |
|
| 114 | 114 | return; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // Dequeue other jQuery styles even if no-conflict is off. |
| 118 | 118 | // Terrible-looking tabs help no one. |
| 119 | - if( !empty( $wp_styles->registered ) ) { |
|
| 120 | - foreach ($wp_styles->registered as $key => $style) { |
|
| 121 | - if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
|
| 119 | + if ( ! empty( $wp_styles->registered ) ) { |
|
| 120 | + foreach ( $wp_styles->registered as $key => $style ) { |
|
| 121 | + if ( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
|
| 122 | 122 | wp_dequeue_style( $key ); |
| 123 | 123 | } |
| 124 | 124 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $no_conflict_mode = gravityview()->plugin->settings->get( 'no-conflict-mode' ); |
| 128 | 128 | |
| 129 | 129 | // If no conflict is off, jQuery will suffice. |
| 130 | - if( empty( $no_conflict_mode ) ) { |
|
| 130 | + if ( empty( $no_conflict_mode ) ) { |
|
| 131 | 131 | return; |
| 132 | 132 | } |
| 133 | 133 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | /** |
| 155 | 155 | * @action `gravityview_remove_conflicts_after` Runs after no-conflict styles are removed. You can re-add styles here. |
| 156 | 156 | */ |
| 157 | - do_action('gravityview_remove_conflicts_after'); |
|
| 157 | + do_action( 'gravityview_remove_conflicts_after' ); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -178,9 +178,9 @@ discard block |
||
| 178 | 178 | |
| 179 | 179 | //reset queue |
| 180 | 180 | $queue = array(); |
| 181 | - foreach( $wp_objects->queue as $object ) { |
|
| 182 | - if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
| 183 | - $queue[] = $object; |
|
| 181 | + foreach ( $wp_objects->queue as $object ) { |
|
| 182 | + if ( in_array( $object, $required_objects ) || preg_match( '/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
| 183 | + $queue[ ] = $object; |
|
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | $wp_objects->queue = $queue; |
@@ -189,8 +189,8 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | //unregistering scripts |
| 191 | 191 | $registered = array(); |
| 192 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
| 193 | - if( in_array( $handle, $required_objects ) ){ |
|
| 192 | + foreach ( $wp_objects->registered as $handle => $script_registration ) { |
|
| 193 | + if ( in_array( $handle, $required_objects ) ) { |
|
| 194 | 194 | $registered[ $handle ] = $script_registration; |
| 195 | 195 | } |
| 196 | 196 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | * @param array $registered [description] |
| 206 | 206 | * @param array $scripts [description] |
| 207 | 207 | */ |
| 208 | - private function add_script_dependencies($registered, $scripts) { |
|
| 208 | + private function add_script_dependencies( $registered, $scripts ) { |
|
| 209 | 209 | |
| 210 | 210 | //gets all dependent scripts linked to the $scripts array passed |
| 211 | 211 | do { |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array(); |
| 215 | 215 | foreach ( $deps as $dep ) { |
| 216 | 216 | if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) { |
| 217 | - $dependents[] = $dep; |
|
| 217 | + $dependents[ ] = $dep; |
|
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @return array |
| 103 | 103 | */ |
| 104 | 104 | public function modify_app_settings_menu_title( $setting_tabs ) { |
| 105 | - $setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview' ); |
|
| 105 | + $setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' ); |
|
| 106 | 106 | return $setting_tabs; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -308,15 +308,15 @@ discard block |
||
| 308 | 308 | </ul> |
| 309 | 309 | <div class="gv-followup widefat"> |
| 310 | 310 | <p><strong><label for="gv-reason-details"><?php esc_html_e( 'Comments', 'gravityview' ); ?></label></strong></p> |
| 311 | - <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview') ?>" placeholder="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview'); ?>" class="large-text"></textarea> |
|
| 311 | + <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ) ?>" placeholder="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ); ?>" class="large-text"></textarea> |
|
| 312 | 312 | </div> |
| 313 | 313 | <div class="scale-description"> |
| 314 | 314 | <p><strong><?php esc_html_e( 'How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p> |
| 315 | 315 | <ul class="inline"> |
| 316 | 316 | <?php |
| 317 | 317 | $i = 0; |
| 318 | - while( $i < 11 ) { |
|
| 319 | - echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_'.$i.'" value="'.$i.'" type="radio"> '.$i.'</label></li>'; |
|
| 318 | + while ( $i < 11 ) { |
|
| 319 | + echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>'; |
|
| 320 | 320 | $i++; |
| 321 | 321 | } |
| 322 | 322 | ?> |
@@ -533,15 +533,15 @@ discard block |
||
| 533 | 533 | * @return string The HTML |
| 534 | 534 | */ |
| 535 | 535 | public function as_html( $field, $echo = true ) { |
| 536 | - $field['type'] = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit','reset','button' ) ) ) ? $field['type'] : 'submit'; |
|
| 536 | + $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
| 537 | 537 | |
| 538 | 538 | $attributes = $this->get_field_attributes( $field ); |
| 539 | 539 | $default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) ); |
| 540 | - $value = $this->get( $field['name'], $default_value ); |
|
| 540 | + $value = $this->get( $field[ 'name' ], $default_value ); |
|
| 541 | 541 | |
| 542 | 542 | |
| 543 | - $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton'; |
|
| 544 | - $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name']; |
|
| 543 | + $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton'; |
|
| 544 | + $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
| 545 | 545 | |
| 546 | 546 | if ( empty( $value ) ) { |
| 547 | 547 | $value = __( 'Update Settings', 'gravityview' ); |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | $attributes = $this->get_field_attributes( $field ); |
| 551 | 551 | |
| 552 | 552 | $html = '<input |
| 553 | - type="' . $field['type'] . '" |
|
| 553 | + type="' . $field[ 'type' ] . '" |
|
| 554 | 554 | name="' . esc_attr( $name ) . '" |
| 555 | 555 | value="' . $value . '" ' . |
| 556 | 556 | implode( ' ', $attributes ) . |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | * @return bool |
| 582 | 582 | */ |
| 583 | 583 | public function is_save_postback() { |
| 584 | - return isset( $_POST['gform-settings-save'] ) && isset( $_POST['_gravityview_save_settings_nonce'] ); |
|
| 584 | + return isset( $_POST[ 'gform-settings-save' ] ) && isset( $_POST[ '_gravityview_save_settings_nonce' ] ); |
|
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | /** |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | */ |
| 592 | 592 | public function license_key_notice() { |
| 593 | 593 | |
| 594 | - if( $this->is_save_postback() ) { |
|
| 594 | + if ( $this->is_save_postback() ) { |
|
| 595 | 595 | $settings = $this->get_posted_settings(); |
| 596 | 596 | $license_key = \GV\Utils::get( $settings, 'license_key' ); |
| 597 | 597 | $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' ); |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | * but didn't want to mess up the translation strings for the translators. |
| 613 | 613 | */ |
| 614 | 614 | $message = mb_substr( $message, 0, mb_strlen( $message ) - 1 ); |
| 615 | - $title = __( 'Inactive License', 'gravityview'); |
|
| 615 | + $title = __( 'Inactive License', 'gravityview' ); |
|
| 616 | 616 | $status = ''; |
| 617 | 617 | $update_below = false; |
| 618 | 618 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | $update_below = __( 'Activate your license key below.', 'gravityview' ); |
| 643 | 643 | break; |
| 644 | 644 | } |
| 645 | - $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice'; |
|
| 645 | + $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice'; |
|
| 646 | 646 | |
| 647 | 647 | // Show a different notice on settings page for inactive licenses (hide the buttons) |
| 648 | 648 | if ( $update_below && gravityview()->request->is_admin( '', 'settings' ) ) { |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | public function scripts() { |
| 687 | 687 | $scripts = parent::scripts(); |
| 688 | 688 | |
| 689 | - $scripts[] = array( |
|
| 689 | + $scripts[ ] = array( |
|
| 690 | 690 | 'handle' => 'gform_tooltip_init', |
| 691 | 691 | 'enqueue' => array( |
| 692 | 692 | array( |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | public function styles() { |
| 706 | 706 | $styles = parent::styles(); |
| 707 | 707 | |
| 708 | - $styles[] = array( |
|
| 708 | + $styles[ ] = array( |
|
| 709 | 709 | 'handle' => 'gravityview_settings', |
| 710 | 710 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
| 711 | 711 | 'version' => Plugin::$version, |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | * If multisite and not network admin, we don't want the settings to show. |
| 737 | 737 | * @since 1.7.6 |
| 738 | 738 | */ |
| 739 | - $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
| 739 | + $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
| 740 | 740 | |
| 741 | 741 | /** |
| 742 | 742 | * Override whether to show the Settings menu on a per-blog basis. |
@@ -784,26 +784,26 @@ discard block |
||
| 784 | 784 | 'label' => __( 'License Key', 'gravityview' ), |
| 785 | 785 | 'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates & support.', 'gravityview' ) . $this->get_license_handler()->license_details( $this->get_app_setting( 'license_key_response' ) ), |
| 786 | 786 | 'type' => 'edd_license', |
| 787 | - 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
| 787 | + 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
| 788 | 788 | 'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
| 789 | - 'default_value' => $default_settings['license_key'], |
|
| 789 | + 'default_value' => $default_settings[ 'license_key' ], |
|
| 790 | 790 | 'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
| 791 | 791 | ), |
| 792 | 792 | array( |
| 793 | 793 | 'name' => 'license_key_response', |
| 794 | - 'default_value' => $default_settings['license_key_response'], |
|
| 794 | + 'default_value' => $default_settings[ 'license_key_response' ], |
|
| 795 | 795 | 'type' => 'hidden', |
| 796 | 796 | ), |
| 797 | 797 | array( |
| 798 | 798 | 'name' => 'license_key_status', |
| 799 | - 'default_value' => $default_settings['license_key_status'], |
|
| 799 | + 'default_value' => $default_settings[ 'license_key_status' ], |
|
| 800 | 800 | 'type' => 'hidden', |
| 801 | 801 | ), |
| 802 | 802 | array( |
| 803 | 803 | 'name' => 'support-email', |
| 804 | 804 | 'type' => 'text', |
| 805 | 805 | 'validate' => 'email', |
| 806 | - 'default_value' => $default_settings['support-email'], |
|
| 806 | + 'default_value' => $default_settings[ 'support-email' ], |
|
| 807 | 807 | 'label' => __( 'Support Email', 'gravityview' ), |
| 808 | 808 | 'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
| 809 | 809 | 'class' => 'code regular-text', |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | 'name' => 'support_port', |
| 816 | 816 | 'type' => 'radio', |
| 817 | 817 | 'label' => __( 'Show Support Port?', 'gravityview' ), |
| 818 | - 'default_value' => $default_settings['support_port'], |
|
| 818 | + 'default_value' => $default_settings[ 'support_port' ], |
|
| 819 | 819 | 'horizontal' => 1, |
| 820 | 820 | 'choices' => array( |
| 821 | 821 | array( |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | 'name' => 'no-conflict-mode', |
| 835 | 835 | 'type' => 'radio', |
| 836 | 836 | 'label' => __( 'No-Conflict Mode', 'gravityview' ), |
| 837 | - 'default_value' => $default_settings['no-conflict-mode'], |
|
| 837 | + 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
| 838 | 838 | 'horizontal' => 1, |
| 839 | 839 | 'choices' => array( |
| 840 | 840 | array( |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | 'name' => 'rest_api', |
| 857 | 857 | 'type' => 'radio', |
| 858 | 858 | 'label' => __( 'REST API', 'gravityview' ), |
| 859 | - 'default_value' => $default_settings['rest_api'], |
|
| 859 | + 'default_value' => $default_settings[ 'rest_api' ], |
|
| 860 | 860 | 'horizontal' => 1, |
| 861 | 861 | 'choices' => array( |
| 862 | 862 | array( |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | 'name' => 'beta', |
| 876 | 876 | 'type' => 'checkbox', |
| 877 | 877 | 'label' => __( 'Become a Beta Tester', 'gravityview' ), |
| 878 | - 'default_value' => $default_settings['beta'], |
|
| 878 | + 'default_value' => $default_settings[ 'beta' ], |
|
| 879 | 879 | 'horizontal' => 1, |
| 880 | 880 | 'choices' => array( |
| 881 | 881 | array( |
@@ -908,17 +908,17 @@ discard block |
||
| 908 | 908 | * @since 1.7.4 |
| 909 | 909 | */ |
| 910 | 910 | foreach ( $fields as &$field ) { |
| 911 | - $field['name'] = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' ); |
|
| 912 | - $field['label'] = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' ); |
|
| 913 | - $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' ); |
|
| 914 | - $field['description'] = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' ); |
|
| 911 | + $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' ); |
|
| 912 | + $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' ); |
|
| 913 | + $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' ); |
|
| 914 | + $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' ); |
|
| 915 | 915 | |
| 916 | 916 | if ( $disabled_attribute ) { |
| 917 | - $field['disabled'] = $disabled_attribute; |
|
| 917 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 918 | 918 | } |
| 919 | 919 | |
| 920 | - if ( empty( $field['disabled'] ) ) { |
|
| 921 | - unset( $field['disabled'] ); |
|
| 920 | + if ( empty( $field[ 'disabled' ] ) ) { |
|
| 921 | + unset( $field[ 'disabled' ] ); |
|
| 922 | 922 | } |
| 923 | 923 | } |
| 924 | 924 | |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | ); |
| 937 | 937 | |
| 938 | 938 | if ( $disabled_attribute ) { |
| 939 | - $button['disabled'] = $disabled_attribute; |
|
| 939 | + $button[ 'disabled' ] = $disabled_attribute; |
|
| 940 | 940 | } |
| 941 | 941 | |
| 942 | 942 | /** |
@@ -955,20 +955,20 @@ discard block |
||
| 955 | 955 | // If there are extensions, add a section for them |
| 956 | 956 | if ( ! empty( $extension_sections ) ) { |
| 957 | 957 | |
| 958 | - if( $disabled_attribute ) { |
|
| 958 | + if ( $disabled_attribute ) { |
|
| 959 | 959 | foreach ( $extension_sections as &$section ) { |
| 960 | - foreach ( $section['fields'] as &$field ) { |
|
| 961 | - $field['disabled'] = $disabled_attribute; |
|
| 960 | + foreach ( $section[ 'fields' ] as &$field ) { |
|
| 961 | + $field[ 'disabled' ] = $disabled_attribute; |
|
| 962 | 962 | } |
| 963 | 963 | } |
| 964 | 964 | } |
| 965 | 965 | |
| 966 | - $k = count( $extension_sections ) - 1 ; |
|
| 967 | - $extension_sections[ $k ]['fields'][] = $button; |
|
| 966 | + $k = count( $extension_sections ) - 1; |
|
| 967 | + $extension_sections[ $k ][ 'fields' ][ ] = $button; |
|
| 968 | 968 | $sections = array_merge( $sections, $extension_sections ); |
| 969 | 969 | } else { |
| 970 | 970 | // add the 'update settings' button to the general section |
| 971 | - $sections[0]['fields'][] = $button; |
|
| 971 | + $sections[ 0 ][ 'fields' ][ ] = $button; |
|
| 972 | 972 | } |
| 973 | 973 | |
| 974 | 974 | return $sections; |
@@ -1024,7 +1024,7 @@ discard block |
||
| 1024 | 1024 | protected function settings_edd_license( $field, $echo = true ) { |
| 1025 | 1025 | |
| 1026 | 1026 | if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
| 1027 | - $field['input_type'] = 'password'; |
|
| 1027 | + $field[ 'input_type' ] = 'password'; |
|
| 1028 | 1028 | } |
| 1029 | 1029 | |
| 1030 | 1030 | $text = $this->settings_text( $field, false ); |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | public function single_setting_row_html( $field ) { |
| 1074 | 1074 | ?> |
| 1075 | 1075 | |
| 1076 | - <tr id="gaddon-setting-row-<?php echo esc_attr( $field['name'] ); ?>"> |
|
| 1076 | + <tr id="gaddon-setting-row-<?php echo esc_attr( $field[ 'name' ] ); ?>"> |
|
| 1077 | 1077 | <td colspan="2"> |
| 1078 | 1078 | <?php $this->single_setting( $field ); ?> |
| 1079 | 1079 | </td> |
@@ -1091,10 +1091,10 @@ discard block |
||
| 1091 | 1091 | * @return string |
| 1092 | 1092 | */ |
| 1093 | 1093 | public function settings_save( $field, $echo = true ) { |
| 1094 | - $field['type'] = 'submit'; |
|
| 1095 | - $field['name'] = 'gform-settings-save'; |
|
| 1096 | - $field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton'; |
|
| 1097 | - $field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
| 1094 | + $field[ 'type' ] = 'submit'; |
|
| 1095 | + $field[ 'name' ] = 'gform-settings-save'; |
|
| 1096 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton'; |
|
| 1097 | + $field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
| 1098 | 1098 | |
| 1099 | 1099 | $output = $this->settings_submit( $field, false ); |
| 1100 | 1100 | |
@@ -1125,8 +1125,8 @@ discard block |
||
| 1125 | 1125 | * @return void |
| 1126 | 1126 | */ |
| 1127 | 1127 | public function single_setting_row( $field ) { |
| 1128 | - $field['gv_description'] = Utils::get( $field, 'description' ); |
|
| 1129 | - $field['description'] = Utils::get( $field, 'subtitle' ); |
|
| 1128 | + $field[ 'gv_description' ] = Utils::get( $field, 'description' ); |
|
| 1129 | + $field[ 'description' ] = Utils::get( $field, 'subtitle' ); |
|
| 1130 | 1130 | parent::single_setting_row( $field ); |
| 1131 | 1131 | } |
| 1132 | 1132 | |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | public function single_setting_label( $field ) { |
| 1139 | 1139 | parent::single_setting_label( $field ); |
| 1140 | 1140 | if ( $description = Utils::get( $field, 'gv_description' ) ) { |
| 1141 | - echo '<span class="description">'. $description .'</span>'; |
|
| 1141 | + echo '<span class="description">' . $description . '</span>'; |
|
| 1142 | 1142 | } |
| 1143 | 1143 | } |
| 1144 | 1144 | |
@@ -1175,9 +1175,9 @@ discard block |
||
| 1175 | 1175 | // If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response), |
| 1176 | 1176 | // then we assume it's changed. If it's changed, unset the status and the previous response. |
| 1177 | 1177 | if ( $local_key !== $response_key ) { |
| 1178 | - unset( $posted_settings['license_key_response'] ); |
|
| 1179 | - unset( $posted_settings['license_key_status'] ); |
|
| 1180 | - \GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
| 1178 | + unset( $posted_settings[ 'license_key_response' ] ); |
|
| 1179 | + unset( $posted_settings[ 'license_key_status' ] ); |
|
| 1180 | + \GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
| 1181 | 1181 | } |
| 1182 | 1182 | return $posted_settings; |
| 1183 | 1183 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | $is_page = false; |
| 40 | 40 | |
| 41 | - if( function_exists( '\get_current_screen' ) || function_exists( 'get_current_screen' ) ) { |
|
| 41 | + if ( function_exists( '\get_current_screen' ) || function_exists( 'get_current_screen' ) ) { |
|
| 42 | 42 | $current_screen = \get_current_screen(); |
| 43 | 43 | } else { |
| 44 | 44 | $current_screen = false; |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | $is_page = 'single'; |
| 52 | 52 | } elseif ( $is_gv_settings = 'gravityview_page_gravityview_settings' === $current_screen->id ) { |
| 53 | 53 | $is_page = 'settings'; |
| 54 | - } elseif( $is_extensions = 'gravityview_page_gv-admin-installer' === $current_screen->id ) { |
|
| 54 | + } elseif ( $is_extensions = 'gravityview_page_gv-admin-installer' === $current_screen->id ) { |
|
| 55 | 55 | $is_page = 'downloads'; |
| 56 | - } elseif( $is_changelog = 'gravityview_page_gv-changelog' === $current_screen->id ) { |
|
| 56 | + } elseif ( $is_changelog = 'gravityview_page_gv-changelog' === $current_screen->id ) { |
|
| 57 | 57 | $is_page = 'changelog'; |
| 58 | - } elseif( $is_getting_started = 'gravityview_page_gv-getting-started' === $current_screen->id ) { |
|
| 58 | + } elseif ( $is_getting_started = 'gravityview_page_gv-getting-started' === $current_screen->id ) { |
|
| 59 | 59 | $is_page = 'getting-started'; |
| 60 | - } elseif( $is_credits = 'gravityview_page_gv-credits' === $current_screen->id ) { |
|
| 60 | + } elseif ( $is_credits = 'gravityview_page_gv-credits' === $current_screen->id ) { |
|
| 61 | 61 | $is_page = 'credits'; |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -40,8 +40,7 @@ discard block |
||
| 40 | 40 | $tab = __( 'Edit Entry', 'gravityview' ); |
| 41 | 41 | $context = 'edit'; |
| 42 | 42 | break; |
| 43 | - case ( $gravityview->request->is_entry( $gravityview->view->form ? $gravityview->view->form->ID : 0 ) ): |
|
| 44 | - $tab = __( 'Single Entry', 'gravityview' ); |
|
| 43 | + case ( $gravityview->request->is_entry( $gravityview->view->form ? $gravityview->view->form->ID : 0 ) ) : $tab = __( 'Single Entry', 'gravityview' ); |
|
| 45 | 44 | $context = 'single'; |
| 46 | 45 | break; |
| 47 | 46 | default: |
@@ -61,7 +60,7 @@ discard block |
||
| 61 | 60 | $action_text = sprintf( esc_html__( 'Add fields to %s', 'gravityview' ), $tab ); |
| 62 | 61 | $message = esc_html__( 'You can only see this message because you are able to edit this View.', 'gravityview' ); |
| 63 | 62 | |
| 64 | - $image = sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url( plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) ); |
|
| 63 | + $image = sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url( plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) ); |
|
| 65 | 64 | $output = sprintf( '<h3>%s <strong><a href="%s">%s</a></strong></h3><p>%s</p>', $title, esc_url( $edit_link ), $action_text, $message ); |
| 66 | 65 | |
| 67 | 66 | echo \GVCommon::generate_notice( $output . $image, 'gv-error error', 'edit_gravityview', $gravityview->view->ID ); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * Try subkeys after split. |
| 92 | 92 | */ |
| 93 | 93 | if ( count( $parts = explode( '/', $key, 2 ) ) > 1 ) { |
| 94 | - return self::get( self::get( $array, $parts[0] ), $parts[1], $default ); |
|
| 94 | + return self::get( self::get( $array, $parts[ 0 ] ), $parts[ 1 ], $default ); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | return $default; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | public static function gf_query_debug( $query ) { |
| 146 | 146 | $introspect = $query->_introspect(); |
| 147 | 147 | return array( |
| 148 | - 'where' => $query->_where_unwrap( $introspect['where'] ) |
|
| 148 | + 'where' => $query->_where_unwrap( $introspect[ 'where' ] ) |
|
| 149 | 149 | ); |
| 150 | 150 | } |
| 151 | 151 | } |