@@ -119,8 +119,8 @@ |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | foreach ( self::$paths as $path ) { |
122 | - if ( 0 === strpos( $file, $path['module_realpath'] ) ) { |
|
123 | - $file = $path['module_path'] . substr( $file, $path['realpath_length'] ); |
|
122 | + if ( 0 === strpos( $file, $path[ 'module_realpath' ] ) ) { |
|
123 | + $file = $path[ 'module_path' ] . substr( $file, $path[ 'realpath_length' ] ); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $message = $message->get_error_message(); |
63 | 63 | } |
64 | 64 | |
65 | - echo $args['before_widget']; // XSS OK here, WPCS. |
|
65 | + echo $args[ 'before_widget' ]; // XSS OK here, WPCS. |
|
66 | 66 | |
67 | 67 | ?> |
68 | 68 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | <?php |
88 | 88 | |
89 | - echo $args['after_widget']; // XSs OK here too, WPCS. |
|
89 | + echo $args[ 'after_widget' ]; // XSs OK here too, WPCS. |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | */ |
107 | 107 | protected function verify_settings( $instance ) { |
108 | 108 | |
109 | - if ( ! isset( $instance['title'] ) ) { |
|
110 | - $instance['title'] = ''; |
|
109 | + if ( ! isset( $instance[ 'title' ] ) ) { |
|
110 | + $instance[ 'title' ] = ''; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | return $instance; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return; |
131 | 131 | } |
132 | 132 | |
133 | - echo $args['before_widget']; // XSS OK here, WPCS. |
|
133 | + echo $args[ 'before_widget' ]; // XSS OK here, WPCS. |
|
134 | 134 | |
135 | 135 | /** |
136 | 136 | * The widget's title. |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @param string $title The widget title. |
141 | 141 | */ |
142 | - $title = apply_filters( 'widget_title', $instance['title'] ); |
|
142 | + $title = apply_filters( 'widget_title', $instance[ 'title' ] ); |
|
143 | 143 | |
144 | 144 | if ( ! empty( $title ) ) { |
145 | 145 | |
146 | - echo $args['before_title'] . $title . $args['after_title']; // XSS OK, WPCS. |
|
146 | + echo $args[ 'before_title' ] . $title . $args[ 'after_title' ]; // XSS OK, WPCS. |
|
147 | 147 | } |
148 | 148 | |
149 | - $widget_slug = $this->widget_options['wordpoints_hook_slug']; |
|
149 | + $widget_slug = $this->widget_options[ 'wordpoints_hook_slug' ]; |
|
150 | 150 | |
151 | 151 | /** |
152 | 152 | * Before a WordPoints widget. |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | do_action( "wordpoints_{$widget_slug}_widget_after", $instance ); |
170 | 170 | |
171 | - echo $args['after_widget']; // XSS OK here too, WPCS. |
|
171 | + echo $args[ 'after_widget' ]; // XSS OK here too, WPCS. |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * @since 2.0.0 |
207 | 207 | */ |
208 | 208 | public function update_title() { |
209 | - $this->instance['title'] = strip_tags( $this->instance['title'] ); |
|
209 | + $this->instance[ 'title' ] = strip_tags( $this->instance[ 'title' ] ); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | <p> |
234 | 234 | <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php echo esc_html_x( 'Title', 'form label', 'wordpoints' ); ?></label> |
235 | - <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $this->instance['title'] ); ?>" /> |
|
235 | + <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $this->instance[ 'title' ] ); ?>" /> |
|
236 | 236 | </p> |
237 | 237 | |
238 | 238 | <?php |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function backup() { |
40 | 40 | |
41 | - $this->backup['original_blog_id'] = get_current_blog_id(); |
|
41 | + $this->backup[ 'original_blog_id' ] = get_current_blog_id(); |
|
42 | 42 | |
43 | - if ( isset( $GLOBALS['_wp_switched_stack'] ) ) { |
|
44 | - $this->backup['switched_stack'] = $GLOBALS['_wp_switched_stack']; |
|
43 | + if ( isset( $GLOBALS[ '_wp_switched_stack' ] ) ) { |
|
44 | + $this->backup[ 'switched_stack' ] = $GLOBALS[ '_wp_switched_stack' ]; |
|
45 | 45 | } |
46 | 46 | |
47 | - if ( isset( $GLOBALS['switched'] ) ) { |
|
48 | - $this->backup['switched'] = $GLOBALS['switched']; |
|
47 | + if ( isset( $GLOBALS[ 'switched' ] ) ) { |
|
48 | + $this->backup[ 'switched' ] = $GLOBALS[ 'switched' ]; |
|
49 | 49 | } |
50 | 50 | |
51 | - return $this->backup['original_blog_id']; |
|
51 | + return $this->backup[ 'original_blog_id' ]; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -62,21 +62,21 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function restore() { |
64 | 64 | |
65 | - switch_to_blog( $this->backup['original_blog_id'] ); |
|
65 | + switch_to_blog( $this->backup[ 'original_blog_id' ] ); |
|
66 | 66 | |
67 | - if ( isset( $this->backup['switched_stack'] ) ) { |
|
68 | - $GLOBALS['_wp_switched_stack'] = $this->backup['switched_stack']; |
|
67 | + if ( isset( $this->backup[ 'switched_stack' ] ) ) { |
|
68 | + $GLOBALS[ '_wp_switched_stack' ] = $this->backup[ 'switched_stack' ]; |
|
69 | 69 | } else { |
70 | - unset( $GLOBALS['_wp_switched_stack'] ); |
|
70 | + unset( $GLOBALS[ '_wp_switched_stack' ] ); |
|
71 | 71 | } |
72 | 72 | |
73 | - if ( isset( $this->backup['switched'] ) ) { |
|
74 | - $GLOBALS['switched'] = $this->backup['switched']; |
|
73 | + if ( isset( $this->backup[ 'switched' ] ) ) { |
|
74 | + $GLOBALS[ 'switched' ] = $this->backup[ 'switched' ]; |
|
75 | 75 | } else { |
76 | - unset( $GLOBALS['switched'] ); |
|
76 | + unset( $GLOBALS[ 'switched' ] ); |
|
77 | 77 | } |
78 | 78 | |
79 | - return $this->backup['original_blog_id']; |
|
79 | + return $this->backup[ 'original_blog_id' ]; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 |