@@ -41,11 +41,11 @@ |
||
| 41 | 41 | $accessibility_mode = get_user_setting( 'wordpoints_points_hooks_access' ); |
| 42 | 42 | |
| 43 | 43 | if ( |
| 44 | - isset( $_GET['accessibility-mode'], $_GET['wordpoints-accessiblity-nonce'] ) |
|
| 44 | + isset( $_GET[ 'accessibility-mode' ], $_GET[ 'wordpoints-accessiblity-nonce' ] ) |
|
| 45 | 45 | && wordpoints_verify_nonce( 'wordpoints-accessiblity-nonce', 'wordpoints_points_hooks_accessiblity' ) |
| 46 | 46 | ) { |
| 47 | 47 | |
| 48 | - $accessibility_mode = ( 'on' === sanitize_key( $_GET['accessibility-mode'] ) ) ? 'on' : 'off'; |
|
| 48 | + $accessibility_mode = ( 'on' === sanitize_key( $_GET[ 'accessibility-mode' ] ) ) ? 'on' : 'off'; |
|
| 49 | 49 | set_user_setting( 'wordpoints_points_hooks_access', $accessibility_mode ); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | foreach ( $points_types as $slug => $settings ) { |
| 49 | 49 | |
| 50 | - $tabs[ $slug ] = $settings['name']; |
|
| 50 | + $tabs[ $slug ] = $settings[ 'name' ]; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | wordpoints_admin_show_tabs( $tabs, false ); |
@@ -43,18 +43,18 @@ discard block |
||
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if ( isset( $_GET['message'] ) && isset( $messages[ (int) $_GET['message'] ] ) ) { // WPCS: CSRF OK. |
|
| 46 | + if ( isset( $_GET[ 'message' ] ) && isset( $messages[ (int) $_GET[ 'message' ] ] ) ) { // WPCS: CSRF OK. |
|
| 47 | 47 | |
| 48 | 48 | wordpoints_show_admin_message( |
| 49 | - esc_html( $messages[ (int) $_GET['message'] ] ) // WPCS: CSRF OK. |
|
| 49 | + esc_html( $messages[ (int) $_GET[ 'message' ] ] ) // WPCS: CSRF OK. |
|
| 50 | 50 | , 'success' |
| 51 | 51 | , array( 'dismissible' => true ) |
| 52 | 52 | ); |
| 53 | 53 | |
| 54 | - } elseif ( isset( $_GET['error'] ) && isset( $errors[ (int) $_GET['error'] ] ) ) { // WPCS: CSRF OK. |
|
| 54 | + } elseif ( isset( $_GET[ 'error' ] ) && isset( $errors[ (int) $_GET[ 'error' ] ] ) ) { // WPCS: CSRF OK. |
|
| 55 | 55 | |
| 56 | 56 | wordpoints_show_admin_error( |
| 57 | - esc_html( $errors[ (int) $_GET['error'] ] ) // WPCS: CSRF OK. |
|
| 57 | + esc_html( $errors[ (int) $_GET[ 'error' ] ] ) // WPCS: CSRF OK. |
|
| 58 | 58 | , array( 'dismissible' => true ) |
| 59 | 59 | ); |
| 60 | 60 | } |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | foreach ( $points_types as $slug => $points_type ) { |
| 125 | 125 | |
| 126 | 126 | $wrap_class = 'hooks-holder-wrap'; |
| 127 | - if ( ! empty( $points_type['class'] ) ) { |
|
| 128 | - $wrap_class .= ' points-type-' . $points_type['class']; |
|
| 127 | + if ( ! empty( $points_type[ 'class' ] ) ) { |
|
| 128 | + $wrap_class .= ' points-type-' . $points_type[ 'class' ]; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if ( $i ) { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | <div class="<?php echo esc_attr( $wrap_class ); ?>"> |
| 138 | 138 | <div class="points-type-name"> |
| 139 | 139 | <div class="points-type-name-arrow"><br /></div> |
| 140 | - <h2><?php echo esc_html( $points_type['name'] ); ?><span class="spinner"></span></h2> |
|
| 140 | + <h2><?php echo esc_html( $points_type[ 'name' ] ); ?><span class="spinner"></span></h2> |
|
| 141 | 141 | </div> |
| 142 | 142 | <div id="<?php echo esc_attr( $slug ); ?>" class="hooks-sortables"> |
| 143 | 143 | |
@@ -43,7 +43,8 @@ discard block |
||
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if ( isset( $_GET['message'] ) && isset( $messages[ (int) $_GET['message'] ] ) ) { // WPCS: CSRF OK. |
|
| 46 | + if ( isset( $_GET['message'] ) && isset( $messages[ (int) $_GET['message'] ] ) ) { |
|
| 47 | +// WPCS: CSRF OK. |
|
| 47 | 48 | |
| 48 | 49 | wordpoints_show_admin_message( |
| 49 | 50 | esc_html( $messages[ (int) $_GET['message'] ] ) // WPCS: CSRF OK. |
@@ -51,7 +52,8 @@ discard block |
||
| 51 | 52 | , array( 'dismissible' => true ) |
| 52 | 53 | ); |
| 53 | 54 | |
| 54 | - } elseif ( isset( $_GET['error'] ) && isset( $errors[ (int) $_GET['error'] ] ) ) { // WPCS: CSRF OK. |
|
| 55 | + } elseif ( isset( $_GET['error'] ) && isset( $errors[ (int) $_GET['error'] ] ) ) { |
|
| 56 | +// WPCS: CSRF OK. |
|
| 55 | 57 | |
| 56 | 58 | wordpoints_show_admin_error( |
| 57 | 59 | esc_html( $errors[ (int) $_GET['error'] ] ) // WPCS: CSRF OK. |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | protected function verify_atts() { |
| 24 | 24 | |
| 25 | - if ( isset( $this->pairs['points_type'] ) ) { |
|
| 25 | + if ( isset( $this->pairs[ 'points_type' ] ) ) { |
|
| 26 | 26 | |
| 27 | 27 | $points_type = $this->get_points_type(); |
| 28 | 28 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | return $points_type; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - $this->atts['points_type'] = $points_type; |
|
| 33 | + $this->atts[ 'points_type' ] = $points_type; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | return parent::verify_atts(); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | protected function get_points_type() { |
| 52 | 52 | |
| 53 | - $points_type = $this->atts['points_type']; |
|
| 53 | + $points_type = $this->atts[ 'points_type' ]; |
|
| 54 | 54 | |
| 55 | 55 | if ( ! wordpoints_is_points_type( $points_type ) ) { |
| 56 | 56 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | protected function verify_atts() { |
| 42 | 42 | |
| 43 | - if ( ! wordpoints_is_points_logs_query( $this->atts['query'] ) ) { |
|
| 43 | + if ( ! wordpoints_is_points_logs_query( $this->atts[ 'query' ] ) ) { |
|
| 44 | 44 | return sprintf( |
| 45 | 45 | // translators: 1. Attribute name; 2. Shortcode name; 3. Example of proper usage. |
| 46 | 46 | __( 'The “%1$s” attribute of the %2$s shortcode must be the slug of a registered points log query. Example: %3$s.', 'wordpoints' ) |
@@ -50,17 +50,17 @@ discard block |
||
| 50 | 50 | ); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if ( false === wordpoints_int( $this->atts['paginate'] ) ) { |
|
| 54 | - $this->atts['paginate'] = 1; |
|
| 53 | + if ( false === wordpoints_int( $this->atts[ 'paginate' ] ) ) { |
|
| 54 | + $this->atts[ 'paginate' ] = 1; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | // Back-compat. Needs to stay here "forever" for legacy installs. |
| 58 | - if ( isset( $this->atts['datatables'] ) ) { |
|
| 59 | - $this->atts['paginate'] = wordpoints_int( $this->atts['datatables'] ); |
|
| 58 | + if ( isset( $this->atts[ 'datatables' ] ) ) { |
|
| 59 | + $this->atts[ 'paginate' ] = wordpoints_int( $this->atts[ 'datatables' ] ); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if ( false === wordpoints_int( $this->atts['show_users'] ) ) { |
|
| 63 | - $this->atts['show_users'] = 1; |
|
| 62 | + if ( false === wordpoints_int( $this->atts[ 'show_users' ] ) ) { |
|
| 63 | + $this->atts[ 'show_users' ] = 1; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return parent::verify_atts(); |
@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | ob_start(); |
| 76 | 76 | wordpoints_show_points_logs_query( |
| 77 | - $this->atts['points_type'] |
|
| 78 | - , $this->atts['query'] |
|
| 77 | + $this->atts[ 'points_type' ] |
|
| 78 | + , $this->atts[ 'query' ] |
|
| 79 | 79 | , array( |
| 80 | - 'paginate' => $this->atts['paginate'], |
|
| 81 | - 'show_users' => $this->atts['show_users'], |
|
| 82 | - 'searchable' => $this->atts['searchable'], |
|
| 80 | + 'paginate' => $this->atts[ 'paginate' ], |
|
| 81 | + 'show_users' => $this->atts[ 'show_users' ], |
|
| 82 | + 'searchable' => $this->atts[ 'searchable' ], |
|
| 83 | 83 | ) |
| 84 | 84 | ); |
| 85 | 85 | |
@@ -37,8 +37,8 @@ |
||
| 37 | 37 | protected function generate() { |
| 38 | 38 | |
| 39 | 39 | return wordpoints_get_formatted_points( |
| 40 | - $this->atts['user_id'] |
|
| 41 | - , $this->atts['points_type'] |
|
| 40 | + $this->atts[ 'user_id' ] |
|
| 41 | + , $this->atts[ 'points_type' ] |
|
| 42 | 42 | , 'points-shortcode' |
| 43 | 43 | ); |
| 44 | 44 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | protected function verify_atts() { |
| 38 | 38 | |
| 39 | - if ( ! wordpoints_posint( $this->atts['users'] ) ) { |
|
| 39 | + if ( ! wordpoints_posint( $this->atts[ 'users' ] ) ) { |
|
| 40 | 40 | return sprintf( |
| 41 | 41 | // translators: 1. Attribute name; 2. Shortcode name; 3. Example of proper usage. |
| 42 | 42 | __( 'The “%1$s” attribute of the %2$s shortcode must be a positive integer. Example: %3$s.', 'wordpoints' ) |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | ob_start(); |
| 59 | 59 | wordpoints_points_show_top_users( |
| 60 | - $this->atts['users'] |
|
| 61 | - , $this->atts['points_type'] |
|
| 60 | + $this->atts[ 'users' ] |
|
| 61 | + , $this->atts[ 'points_type' ] |
|
| 62 | 62 | , 'shortcode' |
| 63 | 63 | ); |
| 64 | 64 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | continue; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - $this->restrictions[] = $restriction; |
|
| 60 | + $this->restrictions[ ] = $restriction; |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | continue; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - $descriptions[] = sprintf( $string, $entity->get_title() ); |
|
| 112 | + $descriptions[ ] = sprintf( $string, $entity->get_title() ); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | return $descriptions; |