@@ -11,10 +11,10 @@ |
||
11 | 11 | ?> |
12 | 12 | |
13 | 13 | <div class="gv-search-box gv-search-date"> |
14 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
15 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
14 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
15 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
16 | 16 | <?php } ?> |
17 | 17 | <p> |
18 | - <input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" > |
|
18 | + <input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" > |
|
19 | 19 | </p> |
20 | 20 | </div> |
21 | 21 | \ No newline at end of file |
@@ -10,10 +10,10 @@ |
||
10 | 10 | |
11 | 11 | ?> |
12 | 12 | <div class="gv-search-box gv-search-field-text"> |
13 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
14 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
13 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
14 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
15 | 15 | <?php } ?> |
16 | 16 | <p> |
17 | - <input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>"> |
|
17 | + <input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>"> |
|
18 | 18 | </p> |
19 | 19 | </div> |
20 | 20 | \ No newline at end of file |
@@ -12,8 +12,8 @@ |
||
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class="gv-search-box gv-search-field-single_checkbox"> |
15 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" class="gv-check-radio"> |
|
16 | - <input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" <?php checked( '1', $search_field['value'], true ); ?>> |
|
17 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { echo esc_html( $search_field['label'] ); } ?> |
|
15 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" class="gv-check-radio"> |
|
16 | + <input type="checkbox" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" <?php checked( '1', $search_field[ 'value' ], true ); ?>> |
|
17 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { echo esc_html( $search_field[ 'label' ] ); } ?> |
|
18 | 18 | </label> |
19 | 19 | </div> |
20 | 20 | \ No newline at end of file |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | * @since 1.0 |
35 | 35 | */ |
36 | 36 | public function __construct() { |
37 | - add_action( 'admin_menu', array( $this, 'admin_menus'), 200 ); |
|
37 | + add_action( 'admin_menu', array( $this, 'admin_menus' ), 200 ); |
|
38 | 38 | add_action( 'admin_head', array( $this, 'admin_head' ) ); |
39 | - add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
40 | - add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page'), 10, 2 ); |
|
39 | + add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
40 | + add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page' ), 10, 2 ); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | // Add help page to GravityView menu |
54 | 54 | add_submenu_page( |
55 | 55 | 'edit.php?post_type=gravityview', |
56 | - __('GravityView: Getting Started', 'gravityview'), |
|
57 | - __('Getting Started', 'gravityview'), |
|
56 | + __( 'GravityView: Getting Started', 'gravityview' ), |
|
57 | + __( 'Getting Started', 'gravityview' ), |
|
58 | 58 | $this->minimum_capability, |
59 | 59 | 'gv-getting-started', |
60 | 60 | array( $this, 'getting_started_screen' ) |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | * |
88 | 88 | * @return boolean $is_page True: yep; false: nope |
89 | 89 | */ |
90 | - public function is_dashboard_page($is_page = false, $hook = NULL) { |
|
90 | + public function is_dashboard_page( $is_page = false, $hook = NULL ) { |
|
91 | 91 | global $plugin_page; |
92 | 92 | |
93 | - if($is_page) { return $is_page; } |
|
93 | + if ( $is_page ) { return $is_page; } |
|
94 | 94 | |
95 | 95 | return in_array( $plugin_page, array( 'gv-about', 'gv-credits', 'gv-getting-started' ) ); |
96 | 96 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-credits' ); |
109 | 109 | remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-changelog' ); |
110 | 110 | |
111 | - if( !$this->is_dashboard_page() ) { return; } |
|
111 | + if ( ! $this->is_dashboard_page() ) { return; } |
|
112 | 112 | |
113 | 113 | ?> |
114 | 114 | <style type="text/css" media="screen" xmlns="http://www.w3.org/1999/html"> |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | // Don't fetch -beta, etc. |
133 | 133 | list( $display_version ) = explode( '-', GravityView_Plugin::version ); |
134 | 134 | |
135 | - $selected = !empty( $plugin_page ) ? $plugin_page : 'gv-getting-started'; |
|
135 | + $selected = ! empty( $plugin_page ) ? $plugin_page : 'gv-getting-started'; |
|
136 | 136 | |
137 | 137 | echo gravityview_get_floaty( 132 ); |
138 | 138 | ?> |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | <div class="about-text"><?php esc_html_e( 'Thank you for installing GravityView. Beautifully display your Gravity Forms entries.', 'gravityview' ); ?></div> |
142 | 142 | |
143 | 143 | <h2 class="nav-tab-wrapper clear"> |
144 | - <a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>"> |
|
144 | + <a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>"> |
|
145 | 145 | <?php _e( "Getting Started", 'gravityview' ); ?> |
146 | 146 | </a> |
147 | - <a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>"> |
|
147 | + <a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>"> |
|
148 | 148 | <?php _e( "List of Changes", 'gravityview' ); ?> |
149 | 149 | </a> |
150 | - <a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>"> |
|
150 | + <a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>"> |
|
151 | 151 | <?php _e( 'Credits', 'gravityview' ); ?> |
152 | 152 | </a> |
153 | 153 | </h2> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | <h3>Create a View</h3> |
183 | 183 | |
184 | 184 | <ol class="ol-decimal"> |
185 | - <li>Go to <a href="<?php echo admin_url('post-new.php?post_type=gravityview'); ?>">Views > New View</a></li> |
|
185 | + <li>Go to <a href="<?php echo admin_url( 'post-new.php?post_type=gravityview' ); ?>">Views > New View</a></li> |
|
186 | 186 | <li>If you want to <strong>create a new form</strong>, click the "Use a Form Preset" button</li> |
187 | 187 | <li>If you want to <strong>use an existing form’s entries</strong>, select from the dropdown.</li> |
188 | 188 | <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>. |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | </ul> |
465 | 465 | |
466 | 466 | <h4><?php esc_attr_e( 'Want to contribute?', 'gravityview' ); ?></h4> |
467 | - <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.', 'gravityview'), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p> |
|
467 | + <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.', 'gravityview' ), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p> |
|
468 | 468 | </div> |
469 | 469 | </div> |
470 | 470 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | global $plugin_page; |
508 | 508 | |
509 | 509 | // Bail if we're just editing the plugin |
510 | - if( $plugin_page === 'plugin-editor.php' ) { return; } |
|
510 | + if ( $plugin_page === 'plugin-editor.php' ) { return; } |
|
511 | 511 | |
512 | 512 | // Bail if no activation redirect |
513 | 513 | if ( ! get_transient( '_gv_activation_redirect' ) ) { return; } |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | $upgrade = get_option( 'gv_version_upgraded_from' ); |
519 | 519 | |
520 | 520 | // Don't do anything if they've already seen the new version info |
521 | - if( $upgrade === GravityView_Plugin::version ) { |
|
521 | + if ( $upgrade === GravityView_Plugin::version ) { |
|
522 | 522 | return; |
523 | 523 | } |
524 | 524 | |
@@ -526,10 +526,10 @@ discard block |
||
526 | 526 | update_option( 'gv_version_upgraded_from', GravityView_Plugin::version ); |
527 | 527 | |
528 | 528 | // Bail if activating from network, or bulk |
529 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; } |
|
529 | + if ( is_network_admin() || isset( $_GET[ 'activate-multi' ] ) ) { return; } |
|
530 | 530 | |
531 | 531 | // First time install |
532 | - if( ! $upgrade ) { |
|
532 | + if ( ! $upgrade ) { |
|
533 | 533 | wp_safe_redirect( admin_url( 'edit.php?post_type=gravityview&page=gv-getting-started' ) ); exit; |
534 | 534 | } |
535 | 535 | // Update |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | $sidebars_widgets = wp_get_sidebars_widgets(); |
82 | - if ( empty( $sidebars_widgets[ $matches[1] ] ) ) { |
|
82 | + if ( empty( $sidebars_widgets[ $matches[ 1 ] ] ) ) { |
|
83 | 83 | return $shortcodes; |
84 | 84 | } |
85 | 85 | |
86 | - foreach ( $sidebars_widgets[ $matches[1] ] as $widgets ) { |
|
86 | + foreach ( $sidebars_widgets[ $matches[ 1 ] ] as $widgets ) { |
|
87 | 87 | if ( |
88 | 88 | /** |
89 | 89 | * Blacklisted widgets. |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | strpos( $widgets, 'gv_recent_entries' ) === 0 |
93 | 93 | ) { |
94 | 94 | |
95 | - $shortcodes []= 'et_pb_sidebar'; |
|
95 | + $shortcodes [ ] = 'et_pb_sidebar'; |
|
96 | 96 | break; |
97 | 97 | } |
98 | 98 | } |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | |
43 | 43 | $args = wp_parse_args( $args, $defaults ); |
44 | 44 | |
45 | - $forms = gravityview_get_forms( (bool) $args['active'], (bool) $args['trash'] ); |
|
45 | + $forms = gravityview_get_forms( (bool)$args[ 'active' ], (bool)$args[ 'trash' ] ); |
|
46 | 46 | |
47 | - if( array() === $args['options'] ) { |
|
47 | + if ( array() === $args[ 'options' ] ) { |
|
48 | 48 | foreach ( $forms as $form ) { |
49 | 49 | |
50 | - if ( in_array( $form['id'], $args['exclude'] ) ) { |
|
50 | + if ( in_array( $form[ 'id' ], $args[ 'exclude' ] ) ) { |
|
51 | 51 | continue; |
52 | 52 | } |
53 | 53 | |
54 | - $args['options'][ $form['id'] ] = esc_html( $form['title'] ); |
|
54 | + $args[ 'options' ][ $form[ 'id' ] ] = esc_html( $form[ 'title' ] ); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -83,15 +83,15 @@ discard block |
||
83 | 83 | |
84 | 84 | $args = wp_parse_args( $args, $defaults ); |
85 | 85 | |
86 | - if( empty( $args['form_id'] ) ) { |
|
86 | + if ( empty( $args[ 'form_id' ] ) ) { |
|
87 | 87 | return ''; |
88 | 88 | } |
89 | 89 | |
90 | - $fields = GVCommon::get_sortable_fields_array( $args['form_id'] ); |
|
90 | + $fields = GVCommon::get_sortable_fields_array( $args[ 'form_id' ] ); |
|
91 | 91 | |
92 | - if( array() === $args['options'] ) { |
|
92 | + if ( array() === $args[ 'options' ] ) { |
|
93 | 93 | foreach ( $fields as $field_id => $field ) { |
94 | - $args['options'][ $field_id ] = esc_html( $field['label'] ); |
|
94 | + $args[ 'options' ][ $field_id ] = esc_html( $field[ 'label' ] ); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
@@ -127,43 +127,43 @@ discard block |
||
127 | 127 | $args = wp_parse_args( $args, $defaults ); |
128 | 128 | |
129 | 129 | $data_elements = ''; |
130 | - foreach ( $args['data'] as $key => $value ) { |
|
130 | + foreach ( $args[ 'data' ] as $key => $value ) { |
|
131 | 131 | $data_elements .= ' data-' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
132 | 132 | } |
133 | 133 | |
134 | - if( $args['multiple'] ) { |
|
134 | + if ( $args[ 'multiple' ] ) { |
|
135 | 135 | $multiple = ' MULTIPLE'; |
136 | 136 | } else { |
137 | 137 | $multiple = ''; |
138 | 138 | } |
139 | 139 | |
140 | - if( $args['placeholder'] ) { |
|
141 | - $placeholder = $args['placeholder']; |
|
140 | + if ( $args[ 'placeholder' ] ) { |
|
141 | + $placeholder = $args[ 'placeholder' ]; |
|
142 | 142 | } else { |
143 | 143 | $placeholder = ''; |
144 | 144 | } |
145 | 145 | |
146 | - $disabled = $args['disabled'] ? ' disabled="disabled"' : ''; |
|
147 | - $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) ); |
|
148 | - $output = '<select name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( str_replace( '-', '_', $args['id'] ) ) . '" class="gravityview-select ' . $class . '"' . $multiple . $disabled . ' data-placeholder="' . $placeholder . '"'. $data_elements . '>'; |
|
146 | + $disabled = $args[ 'disabled' ] ? ' disabled="disabled"' : ''; |
|
147 | + $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args[ 'class' ] ) ) ); |
|
148 | + $output = '<select name="' . esc_attr( $args[ 'name' ] ) . '" id="' . esc_attr( str_replace( '-', '_', $args[ 'id' ] ) ) . '" class="gravityview-select ' . $class . '"' . $multiple . $disabled . ' data-placeholder="' . $placeholder . '"' . $data_elements . '>'; |
|
149 | 149 | |
150 | - if ( ! empty( $args['options'] ) ) { |
|
150 | + if ( ! empty( $args[ 'options' ] ) ) { |
|
151 | 151 | |
152 | - if ( $args['show_option_none'] ) { |
|
153 | - if( $args['multiple'] ) { |
|
154 | - $selected = selected( true, in_array( -1, $args['selected'] ), false ); |
|
152 | + if ( $args[ 'show_option_none' ] ) { |
|
153 | + if ( $args[ 'multiple' ] ) { |
|
154 | + $selected = selected( true, in_array( -1, $args[ 'selected' ] ), false ); |
|
155 | 155 | } else { |
156 | - $selected = selected( $args['selected'], -1, false ); |
|
156 | + $selected = selected( $args[ 'selected' ], -1, false ); |
|
157 | 157 | } |
158 | - $output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>'; |
|
158 | + $output .= '<option value="-1"' . $selected . '>' . esc_html( $args[ 'show_option_none' ] ) . '</option>'; |
|
159 | 159 | } |
160 | 160 | |
161 | - foreach( $args['options'] as $key => $option ) { |
|
161 | + foreach ( $args[ 'options' ] as $key => $option ) { |
|
162 | 162 | |
163 | - if( $args['multiple'] && is_array( $args['selected'] ) ) { |
|
164 | - $selected = selected( true, in_array( $key, $args['selected'], true ), false ); |
|
163 | + if ( $args[ 'multiple' ] && is_array( $args[ 'selected' ] ) ) { |
|
164 | + $selected = selected( true, in_array( $key, $args[ 'selected' ], true ), false ); |
|
165 | 165 | } else { |
166 | - $selected = selected( $args['selected'], $key, false ); |
|
166 | + $selected = selected( $args[ 'selected' ], $key, false ); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | $output .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option ) . '</option>'; |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | function parse_um_profile_post_content( $args = array() ) { |
44 | 44 | global $ultimatemember; |
45 | 45 | |
46 | - if( ! $ultimatemember || ! is_object( $ultimatemember ) || ! class_exists( 'GravityView_View_Data' ) ) { |
|
46 | + if ( ! $ultimatemember || ! is_object( $ultimatemember ) || ! class_exists( 'GravityView_View_Data' ) ) { |
|
47 | 47 | return; |
48 | 48 | } |
49 | 49 | |
50 | 50 | // @todo Support Ultimate Member 2.0 - for now, prevent fatal error |
51 | - if( ! isset( $ultimatemember->profile ) ) { |
|
51 | + if ( ! isset( $ultimatemember->profile ) ) { |
|
52 | 52 | return; |
53 | 53 | } |
54 | 54 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | return; |
65 | 65 | } |
66 | 66 | |
67 | - GravityView_View_Data::getInstance()->parse_post_content( $active_tab[0]->post_content ); |
|
67 | + GravityView_View_Data::getInstance()->parse_post_content( $active_tab[ 0 ]->post_content ); |
|
68 | 68 | |
69 | 69 | wp_reset_postdata(); |
70 | 70 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | */ |
46 | 46 | function filter_file_path( $file_path = '', $file_path_info = array(), $field_settings = array() ) { |
47 | 47 | |
48 | - $file_path = str_replace('www.dropbox.com', 'dl.dropboxusercontent.com', $file_path ); |
|
48 | + $file_path = str_replace( 'www.dropbox.com', 'dl.dropboxusercontent.com', $file_path ); |
|
49 | 49 | $file_path = str_replace( '?dl=0', '', $file_path ); |
50 | 50 | |
51 | 51 | return $file_path; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public static function get_instance() { |
35 | 35 | |
36 | - if( ! self::$instance ) { |
|
36 | + if ( ! self::$instance ) { |
|
37 | 37 | self::$instance = new self; |
38 | 38 | } |
39 | 39 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | add_filter( 'members_get_capabilities', array( 'GravityView_Roles_Capabilities', 'merge_with_all_caps' ) ); |
57 | 57 | add_action( 'members_register_cap_groups', array( $this, 'members_register_cap_group' ), 20 ); |
58 | 58 | add_filter( 'user_has_cap', array( $this, 'filter_user_has_cap' ), 10, 4 ); |
59 | - add_action( 'admin_init', array( $this, 'add_caps') ); |
|
59 | + add_action( 'admin_init', array( $this, 'add_caps' ) ); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -77,18 +77,18 @@ discard block |
||
77 | 77 | public function filter_user_has_cap( $usercaps = array(), $caps = array(), $args = array(), $user = NULL ) { |
78 | 78 | |
79 | 79 | // Empty caps_to_check array |
80 | - if( ! $usercaps || ! $caps ) { |
|
80 | + if ( ! $usercaps || ! $caps ) { |
|
81 | 81 | return $usercaps; |
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
85 | 85 | * Enable all GravityView caps_to_check if `gravityview_full_access` is enabled |
86 | 86 | */ |
87 | - if( ! empty( $usercaps['gravityview_full_access'] ) ) { |
|
87 | + if ( ! empty( $usercaps[ 'gravityview_full_access' ] ) ) { |
|
88 | 88 | |
89 | 89 | $all_gravityview_caps = self::all_caps(); |
90 | 90 | |
91 | - foreach( $all_gravityview_caps as $gv_cap ) { |
|
91 | + foreach ( $all_gravityview_caps as $gv_cap ) { |
|
92 | 92 | $usercaps[ $gv_cap ] = true; |
93 | 93 | } |
94 | 94 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $all = $administrator; |
307 | 307 | |
308 | 308 | // If role is set, return caps_to_check for just that role. |
309 | - if( $single_role ) { |
|
309 | + if ( $single_role ) { |
|
310 | 310 | $caps = isset( ${$single_role} ) ? ${$single_role} : false; |
311 | 311 | return $flat_array ? $caps : array( $single_role => $caps ); |
312 | 312 | } |
@@ -355,9 +355,9 @@ discard block |
||
355 | 355 | |
356 | 356 | if ( true === $allow_logged_out ) { |
357 | 357 | |
358 | - $all_caps = self::all_caps('editor'); |
|
358 | + $all_caps = self::all_caps( 'editor' ); |
|
359 | 359 | |
360 | - if( array_intersect( $all_caps, (array) $caps_to_check ) ) { |
|
360 | + if ( array_intersect( $all_caps, (array)$caps_to_check ) ) { |
|
361 | 361 | return true; |
362 | 362 | } |
363 | 363 | } |
@@ -378,13 +378,13 @@ discard block |
||
378 | 378 | $caps_to_check = self::maybe_add_full_access_caps( $caps_to_check ); |
379 | 379 | |
380 | 380 | foreach ( $caps_to_check as $cap ) { |
381 | - if( ! is_null( $object_id ) ) { |
|
381 | + if ( ! is_null( $object_id ) ) { |
|
382 | 382 | $has_cap = $user_id ? user_can( $user_id, $cap, $object_id ) : current_user_can( $cap, $object_id ); |
383 | 383 | } else { |
384 | 384 | $has_cap = $user_id ? user_can( $user_id, $cap ) : current_user_can( $cap ); |
385 | 385 | } |
386 | 386 | // At the first successful response, stop checking |
387 | - if( $has_cap ) { |
|
387 | + if ( $has_cap ) { |
|
388 | 388 | break; |
389 | 389 | } |
390 | 390 | } |
@@ -408,15 +408,15 @@ discard block |
||
408 | 408 | $all_gravityview_caps = self::all_caps(); |
409 | 409 | |
410 | 410 | // Are there any $caps_to_check that are from GravityView? |
411 | - if( $has_gravityview_caps = array_intersect( $caps_to_check, $all_gravityview_caps ) ) { |
|
412 | - $caps_to_check[] = 'gravityview_full_access'; |
|
411 | + if ( $has_gravityview_caps = array_intersect( $caps_to_check, $all_gravityview_caps ) ) { |
|
412 | + $caps_to_check[ ] = 'gravityview_full_access'; |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | $all_gravity_forms_caps = class_exists( 'GFCommon' ) ? GFCommon::all_caps() : array(); |
416 | 416 | |
417 | 417 | // Are there any $caps_to_check that are from Gravity Forms? |
418 | - if( $all_gravity_forms_caps = array_intersect( $caps_to_check, $all_gravity_forms_caps ) ) { |
|
419 | - $caps_to_check[] = 'gform_full_access'; |
|
418 | + if ( $all_gravity_forms_caps = array_intersect( $caps_to_check, $all_gravity_forms_caps ) ) { |
|
419 | + $caps_to_check[ ] = 'gform_full_access'; |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | return array_unique( $caps_to_check ); |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | $capabilities = self::all_caps(); |
439 | 439 | |
440 | 440 | // Loop through each role and remove GV caps_to_check |
441 | - foreach( $wp_roles->get_names() as $role_slug => $role_name ) { |
|
441 | + foreach ( $wp_roles->get_names() as $role_slug => $role_name ) { |
|
442 | 442 | foreach ( $capabilities as $cap ) { |
443 | 443 | $wp_roles->remove_cap( $role_slug, $cap ); |
444 | 444 | } |