@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | foreach ( array( 'all', $log->log_type ) as $slug ) { |
| 43 | 43 | |
| 44 | - if ( isset( $this->classes[ $slug ] ) ) { |
|
| 44 | + if ( isset( $this->classes[$slug] ) ) { |
|
| 45 | 45 | |
| 46 | 46 | $restrictions = array_merge( |
| 47 | 47 | $restrictions |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | continue; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $this->restrictions[ $entity_slug ] = $restriction; |
|
| 85 | + $this->restrictions[$entity_slug] = $restriction; |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | $instances = $this->get_instances(); |
| 117 | 117 | |
| 118 | - if ( isset( $instances[ $number ]['points'] ) ) { |
|
| 119 | - return $instances[ $number ]['points']; |
|
| 118 | + if ( isset( $instances[$number]['points'] ) ) { |
|
| 119 | + return $instances[$number]['points']; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | return false; |
@@ -340,9 +340,9 @@ discard block |
||
| 340 | 340 | */ |
| 341 | 341 | final public function get_option( $option ) { |
| 342 | 342 | |
| 343 | - if ( isset( $this->options[ $option ] ) ) { |
|
| 343 | + if ( isset( $this->options[$option] ) ) { |
|
| 344 | 344 | |
| 345 | - return $this->options[ $option ]; |
|
| 345 | + return $this->options[$option]; |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | return null; |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | */ |
| 372 | 372 | final public function set_option( $option, $value ) { |
| 373 | 373 | |
| 374 | - $this->options[ $option ] = $value; |
|
| 374 | + $this->options[$option] = $value; |
|
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | /** |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | |
| 437 | 437 | if ( is_multisite() ) { |
| 438 | 438 | foreach ( wordpoints_get_array_option( $this->option_name, 'site' ) as $number => $instance ) { |
| 439 | - $instances[ 'network_' . $number ] = $instance; |
|
| 439 | + $instances['network_' . $number] = $instance; |
|
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | 442 | break; |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | |
| 471 | 471 | $this->set_number( $number ); |
| 472 | 472 | |
| 473 | - $old_instance = isset( $all_instances[ $this->number ] ) ? $all_instances[ $this->number ] : array(); |
|
| 473 | + $old_instance = isset( $all_instances[$this->number] ) ? $all_instances[$this->number] : array(); |
|
| 474 | 474 | |
| 475 | 475 | $instance = $this->update( $new_instance, $old_instance ); |
| 476 | 476 | |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | $instance = apply_filters( 'wordpoints_points_hook_update_callback', $instance, $new_instance, $old_instance, $this ); |
| 492 | 492 | |
| 493 | 493 | if ( false !== $instance ) { |
| 494 | - $all_instances[ $this->number ] = $instance; |
|
| 494 | + $all_instances[$this->number] = $instance; |
|
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | $this->save_instances( $all_instances ); |
@@ -517,9 +517,9 @@ discard block |
||
| 517 | 517 | |
| 518 | 518 | $number = $this->get_number_by_id( $hook_id ); |
| 519 | 519 | |
| 520 | - if ( isset( $all_instances[ $number ] ) ) { |
|
| 520 | + if ( isset( $all_instances[$number] ) ) { |
|
| 521 | 521 | |
| 522 | - unset( $all_instances[ $number ] ); |
|
| 522 | + unset( $all_instances[$number] ); |
|
| 523 | 523 | |
| 524 | 524 | $this->save_instances( $all_instances ); |
| 525 | 525 | } |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | |
| 555 | 555 | } else { |
| 556 | 556 | |
| 557 | - $instance = $all_instances[ $this->number ]; |
|
| 557 | + $instance = $all_instances[$this->number]; |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | /** |
@@ -673,11 +673,11 @@ discard block |
||
| 673 | 673 | |
| 674 | 674 | $instances = $this->get_instances(); |
| 675 | 675 | |
| 676 | - if ( 'generated' !== $type && ! empty( $instances[ $this->number ]['_description'] ) ) { |
|
| 677 | - return $instances[ $this->number ]['_description']; |
|
| 676 | + if ( 'generated' !== $type && ! empty( $instances[$this->number]['_description'] ) ) { |
|
| 677 | + return $instances[$this->number]['_description']; |
|
| 678 | 678 | } |
| 679 | 679 | |
| 680 | - $instance = ( isset( $instances[ $this->number ] ) ) ? $instances[ $this->number ] : array(); |
|
| 680 | + $instance = ( isset( $instances[$this->number] ) ) ? $instances[$this->number] : array(); |
|
| 681 | 681 | |
| 682 | 682 | /** |
| 683 | 683 | * Filter the description for a points hook. |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | foreach ( $classes as $class_name ) { |
| 135 | 135 | |
| 136 | 136 | $hook_type = new $class_name(); |
| 137 | - self::$hook_types[ $hook_type->get_id_base() ] = $hook_type; |
|
| 137 | + self::$hook_types[$hook_type->get_id_base()] = $hook_type; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | $instances = $hook_type->get_instances( $type ); |
| 182 | 182 | |
| 183 | - if ( ! isset( $instances[ $id_number ] ) ) { |
|
| 183 | + if ( ! isset( $instances[$id_number] ) ) { |
|
| 184 | 184 | return false; |
| 185 | 185 | } |
| 186 | 186 | |
@@ -203,11 +203,11 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | public static function get_handler_by_id_base( $id_base ) { |
| 205 | 205 | |
| 206 | - if ( ! isset( self::$hook_types[ $id_base ] ) ) { |
|
| 206 | + if ( ! isset( self::$hook_types[$id_base] ) ) { |
|
| 207 | 207 | return false; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - return self::$hook_types[ $id_base ]; |
|
| 210 | + return self::$hook_types[$id_base]; |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | // Display a representative for each hook type. |
| 279 | 279 | foreach ( $hook_types as $id_base => $hook_type ) { |
| 280 | 280 | |
| 281 | - if ( isset( $disabled_hooks[ $id_base ] ) ) { |
|
| 281 | + if ( isset( $disabled_hooks[$id_base] ) ) { |
|
| 282 | 282 | continue; |
| 283 | 283 | } |
| 284 | 284 | |
@@ -412,8 +412,8 @@ discard block |
||
| 412 | 412 | |
| 413 | 413 | $points_types_hooks = self::get_points_types_hooks(); |
| 414 | 414 | |
| 415 | - if ( isset( $points_types_hooks[ $slug ] ) && is_array( $points_types_hooks[ $slug ] ) ) { |
|
| 416 | - $points_type_hooks = $points_types_hooks[ $slug ]; |
|
| 415 | + if ( isset( $points_types_hooks[$slug] ) && is_array( $points_types_hooks[$slug] ) ) { |
|
| 416 | + $points_type_hooks = $points_types_hooks[$slug]; |
|
| 417 | 417 | } else { |
| 418 | 418 | $points_type_hooks = array(); |
| 419 | 419 | } |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | foreach ( wordpoints_get_points_types() as $slug => $settings ) { |
| 473 | 473 | |
| 474 | - $defaults[ $slug ] = array(); |
|
| 474 | + $defaults[$slug] = array(); |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | return $defaults; |
@@ -255,7 +255,7 @@ |
||
| 255 | 255 | |
| 256 | 256 | foreach ( wordpoints_get_points_types() as $slug => $settings ) { |
| 257 | 257 | |
| 258 | - $points_types[ $slug ] = $settings['name']; |
|
| 258 | + $points_types[$slug] = $settings['name']; |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | if ( isset( $args['options'] ) && is_array( $args['options'] ) ) { |
@@ -84,8 +84,8 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | if ( |
| 87 | - ! isset( $last_visit[ $points_type ] ) |
|
| 88 | - || (int) ( $last_visit[ $points_type ] / $instance['period'] ) < (int) ( $now / $instance['period'] ) |
|
| 87 | + ! isset( $last_visit[$points_type] ) |
|
| 88 | + || (int) ( $last_visit[$points_type] / $instance['period'] ) < (int) ( $now / $instance['period'] ) |
|
| 89 | 89 | ) { |
| 90 | 90 | |
| 91 | 91 | wordpoints_add_points( |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | , array( 'period' => $instance['period'] ) |
| 97 | 97 | ); |
| 98 | 98 | |
| 99 | - $last_visit[ $points_type ] = $now; |
|
| 99 | + $last_visit[$points_type] = $now; |
|
| 100 | 100 | |
| 101 | 101 | $awarded_points = true; |
| 102 | 102 | } |
@@ -261,9 +261,9 @@ discard block |
||
| 261 | 261 | protected function get_periods() { |
| 262 | 262 | |
| 263 | 263 | $periods = array( |
| 264 | - HOUR_IN_SECONDS => __( 'hourly' , 'wordpoints' ), |
|
| 265 | - DAY_IN_SECONDS => __( 'daily' , 'wordpoints' ), |
|
| 266 | - WEEK_IN_SECONDS => __( 'weekly' , 'wordpoints' ), |
|
| 264 | + HOUR_IN_SECONDS => __( 'hourly', 'wordpoints' ), |
|
| 265 | + DAY_IN_SECONDS => __( 'daily', 'wordpoints' ), |
|
| 266 | + WEEK_IN_SECONDS => __( 'weekly', 'wordpoints' ), |
|
| 267 | 267 | 30 * DAY_IN_SECONDS => __( 'monthly', 'wordpoints' ), |
| 268 | 268 | ); |
| 269 | 269 | |
@@ -204,10 +204,10 @@ discard block |
||
| 204 | 204 | if ( |
| 205 | 205 | // Support passing these as null to override the defaults. |
| 206 | 206 | ! array_key_exists( "{$arg}_id", $this->args ) |
| 207 | - && ! isset( $this->args[ "{$arg}_id__in" ] ) |
|
| 208 | - && ! isset( $this->args[ "{$arg}_id__not_in" ] ) |
|
| 207 | + && ! isset( $this->args["{$arg}_id__in"] ) |
|
| 208 | + && ! isset( $this->args["{$arg}_id__not_in"] ) |
|
| 209 | 209 | ) { |
| 210 | - $this->args[ "{$arg}_id" ] = $wpdb->{"{$arg}id"}; |
|
| 210 | + $this->args["{$arg}_id"] = $wpdb->{"{$arg}id"}; |
|
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | } |
@@ -537,19 +537,19 @@ discard block |
||
| 537 | 537 | |
| 538 | 538 | $this->calc_cache_query_hash(); |
| 539 | 539 | |
| 540 | - if ( ! isset( $cache[ $this->_cache_query_hash ] ) ) { |
|
| 540 | + if ( ! isset( $cache[$this->_cache_query_hash] ) ) { |
|
| 541 | 541 | return false; |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | if ( isset( $type ) ) { |
| 545 | - if ( isset( $cache[ $this->_cache_query_hash ][ $type ] ) ) { |
|
| 546 | - return $cache[ $this->_cache_query_hash ][ $type ]; |
|
| 545 | + if ( isset( $cache[$this->_cache_query_hash][$type] ) ) { |
|
| 546 | + return $cache[$this->_cache_query_hash][$type]; |
|
| 547 | 547 | } else { |
| 548 | 548 | return false; |
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | - return $cache[ $this->_cache_query_hash ]; |
|
| 552 | + return $cache[$this->_cache_query_hash]; |
|
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | /** |
@@ -568,16 +568,16 @@ discard block |
||
| 568 | 568 | $this->calc_cache_query_hash(); |
| 569 | 569 | |
| 570 | 570 | if ( |
| 571 | - ! isset( $cache[ $this->_cache_query_hash ] ) |
|
| 572 | - || ! is_array( $cache[ $this->_cache_query_hash ] ) |
|
| 571 | + ! isset( $cache[$this->_cache_query_hash] ) |
|
| 572 | + || ! is_array( $cache[$this->_cache_query_hash] ) |
|
| 573 | 573 | ) { |
| 574 | - $cache[ $this->_cache_query_hash ] = array(); |
|
| 574 | + $cache[$this->_cache_query_hash] = array(); |
|
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | if ( isset( $type ) ) { |
| 578 | - $cache[ $this->_cache_query_hash ][ $type ] = $value; |
|
| 578 | + $cache[$this->_cache_query_hash][$type] = $value; |
|
| 579 | 579 | } else { |
| 580 | - $cache[ $this->_cache_query_hash ] = $value; |
|
| 580 | + $cache[$this->_cache_query_hash] = $value; |
|
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | wp_cache_set( $this->_cache_key, $cache, $this->_cache_group ); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | $points_types = wordpoints_get_points_types(); |
| 25 | 25 | |
| 26 | - return isset( $points_types[ $slug ] ); |
|
| 26 | + return isset( $points_types[$slug] ); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -71,11 +71,11 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | $points_types = wordpoints_get_points_types(); |
| 73 | 73 | |
| 74 | - if ( ! isset( $points_types[ $slug ] ) ) { |
|
| 74 | + if ( ! isset( $points_types[$slug] ) ) { |
|
| 75 | 75 | return false; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - return $points_types[ $slug ]; |
|
| 78 | + return $points_types[$slug]; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | $points_type = wordpoints_get_points_type( $slug ); |
| 97 | 97 | |
| 98 | - if ( isset( $points_type[ $setting ] ) ) { |
|
| 99 | - return $points_type[ $setting ]; |
|
| 98 | + if ( isset( $points_type[$setting] ) ) { |
|
| 99 | + return $points_type[$setting]; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | return null; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | $points_types = wordpoints_get_points_types(); |
| 131 | 131 | |
| 132 | - if ( empty( $slug ) || isset( $points_types[ $slug ] ) ) { |
|
| 132 | + if ( empty( $slug ) || isset( $points_types[$slug] ) ) { |
|
| 133 | 133 | return false; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | * @param string $slug The slug for this points type. |
| 143 | 143 | * @param bool $is_new Whether this points type is new, or being updated. |
| 144 | 144 | */ |
| 145 | - $points_types[ $slug ] = apply_filters( 'wordpoints_points_settings', $settings, $slug, true ); |
|
| 145 | + $points_types[$slug] = apply_filters( 'wordpoints_points_settings', $settings, $slug, true ); |
|
| 146 | 146 | |
| 147 | 147 | if ( ! wordpoints_update_maybe_network_option( 'wordpoints_points_types', $points_types ) ) { |
| 148 | 148 | return false; |
@@ -165,14 +165,14 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $points_types = wordpoints_get_points_types(); |
| 167 | 167 | |
| 168 | - if ( ! is_array( $settings ) || ! isset( $points_types[ $slug ], $settings['name'] ) ) { |
|
| 168 | + if ( ! is_array( $settings ) || ! isset( $points_types[$slug], $settings['name'] ) ) { |
|
| 169 | 169 | return false; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
| 173 | 173 | * @see wordpoints_add_points_type() |
| 174 | 174 | */ |
| 175 | - $points_types[ $slug ] = apply_filters( 'wordpoints_points_settings', $settings, $slug, false ); |
|
| 175 | + $points_types[$slug] = apply_filters( 'wordpoints_points_settings', $settings, $slug, false ); |
|
| 176 | 176 | |
| 177 | 177 | return wordpoints_update_maybe_network_option( 'wordpoints_points_types', $points_types ); |
| 178 | 178 | } |
@@ -1035,13 +1035,13 @@ discard block |
||
| 1035 | 1035 | , array( '%d' ) |
| 1036 | 1036 | ); |
| 1037 | 1037 | |
| 1038 | - if ( ! isset( $flushed['points_types'][ $log->points_type ], $flushed['user_ids'][ $log->user_id ] ) ) { |
|
| 1038 | + if ( ! isset( $flushed['points_types'][$log->points_type], $flushed['user_ids'][$log->user_id] ) ) { |
|
| 1039 | 1039 | wordpoints_flush_points_logs_caches( |
| 1040 | 1040 | array( 'user_id' => $log->user_id, 'points_type' => $log->points_type ) |
| 1041 | 1041 | ); |
| 1042 | 1042 | |
| 1043 | - $flushed['points_types'][ $log->points_type ] = true; |
|
| 1044 | - $flushed['user_ids'][ $log->user_id ] = true; |
|
| 1043 | + $flushed['points_types'][$log->points_type] = true; |
|
| 1044 | + $flushed['user_ids'][$log->user_id] = true; |
|
| 1045 | 1045 | } |
| 1046 | 1046 | } |
| 1047 | 1047 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | return; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | -$rank_group = $rank_groups[ wordpoints_admin_get_current_tab( $rank_groups ) ]; |
|
| 23 | +$rank_group = $rank_groups[wordpoints_admin_get_current_tab( $rank_groups )]; |
|
| 24 | 24 | |
| 25 | 25 | ?> |
| 26 | 26 | |