@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | $module_data = wordpoints_get_module_data( wordpoints_modules_dir() . '/' . $module ); |
| 71 | 71 | |
| 72 | - return $module_data['network']; |
|
| 72 | + return $module_data[ 'network' ]; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -257,17 +257,17 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | $module_data = WordPoints_Modules::get_data( $module_file ); |
| 259 | 259 | |
| 260 | - if ( $module_data && wp_normalize_path( $module_file ) === $module_data['raw_file'] ) { |
|
| 261 | - unset( $module_data['raw'], $module_data['raw_file'] ); |
|
| 260 | + if ( $module_data && wp_normalize_path( $module_file ) === $module_data[ 'raw_file' ] ) { |
|
| 261 | + unset( $module_data[ 'raw' ], $module_data[ 'raw_file' ] ); |
|
| 262 | 262 | } else { |
| 263 | 263 | $module_data = get_file_data( $module_file, $default_headers, 'wordpoints_module' ); |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | - if ( ! empty( $module_data['update_api'] ) ) { |
|
| 266 | + if ( ! empty( $module_data[ 'update_api' ] ) ) { |
|
| 267 | 267 | _deprecated_argument( __FUNCTION__, '1.10.0', 'The "Update API" module header has been deprecated in favor of "Channel".' ); |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - $module_data['network'] = ( 'true' === strtolower( $module_data['network'] ) ); |
|
| 270 | + $module_data[ 'network' ] = ( 'true' === strtolower( $module_data[ 'network' ] ) ); |
|
| 271 | 271 | |
| 272 | 272 | if ( $markup || $translate ) { |
| 273 | 273 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | // Translate fields |
| 278 | 278 | if ( $translate ) { |
| 279 | 279 | |
| 280 | - $textdomain = $module_data['text_domain']; |
|
| 280 | + $textdomain = $module_data[ 'text_domain' ]; |
|
| 281 | 281 | |
| 282 | 282 | if ( $textdomain ) { |
| 283 | 283 | |
@@ -285,8 +285,8 @@ discard block |
||
| 285 | 285 | |
| 286 | 286 | $domain_path = dirname( $module_file ); |
| 287 | 287 | |
| 288 | - if ( $module_data['domain_path'] ) { |
|
| 289 | - $domain_path .= $module_data['domain_path']; |
|
| 288 | + if ( $module_data[ 'domain_path' ] ) { |
|
| 289 | + $domain_path .= $module_data[ 'domain_path' ]; |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | wordpoints_load_module_textdomain( $textdomain, $domain_path ); |
@@ -309,48 +309,48 @@ discard block |
||
| 309 | 309 | ); |
| 310 | 310 | |
| 311 | 311 | $allowed_tags = $allowed_tags_in_links; |
| 312 | - $allowed_tags['a'] = array( 'href' => true, 'title' => true ); |
|
| 312 | + $allowed_tags[ 'a' ] = array( 'href' => true, 'title' => true ); |
|
| 313 | 313 | |
| 314 | 314 | // Name and author ar marked up inside <a> tags. Don't allow these. |
| 315 | - $module_data['name'] = wp_kses( $module_data['name'], $allowed_tags_in_links ); |
|
| 316 | - $module_data['author'] = wp_kses( $module_data['author'], $allowed_tags_in_links ); |
|
| 315 | + $module_data[ 'name' ] = wp_kses( $module_data[ 'name' ], $allowed_tags_in_links ); |
|
| 316 | + $module_data[ 'author' ] = wp_kses( $module_data[ 'author' ], $allowed_tags_in_links ); |
|
| 317 | 317 | |
| 318 | - $module_data['description'] = wp_kses( $module_data['description'], $allowed_tags ); |
|
| 319 | - $module_data['version'] = wp_kses( $module_data['version'], $allowed_tags ); |
|
| 318 | + $module_data[ 'description' ] = wp_kses( $module_data[ 'description' ], $allowed_tags ); |
|
| 319 | + $module_data[ 'version' ] = wp_kses( $module_data[ 'version' ], $allowed_tags ); |
|
| 320 | 320 | |
| 321 | - $module_data['module_uri'] = esc_url( $module_data['module_uri'] ); |
|
| 322 | - $module_data['author_uri'] = esc_url( $module_data['author_uri'] ); |
|
| 321 | + $module_data[ 'module_uri' ] = esc_url( $module_data[ 'module_uri' ] ); |
|
| 322 | + $module_data[ 'author_uri' ] = esc_url( $module_data[ 'author_uri' ] ); |
|
| 323 | 323 | |
| 324 | - $module_data['title'] = $module_data['name']; |
|
| 325 | - $module_data['author_name'] = $module_data['author']; |
|
| 324 | + $module_data[ 'title' ] = $module_data[ 'name' ]; |
|
| 325 | + $module_data[ 'author_name' ] = $module_data[ 'author' ]; |
|
| 326 | 326 | |
| 327 | 327 | // Apply markup. |
| 328 | 328 | if ( $markup ) { |
| 329 | 329 | |
| 330 | - if ( $module_data['module_uri'] && $module_data['name'] ) { |
|
| 331 | - $module_data['title'] = '<a href="' . $module_data['module_uri'] |
|
| 332 | - . '">' . $module_data['name'] . '</a>'; |
|
| 330 | + if ( $module_data[ 'module_uri' ] && $module_data[ 'name' ] ) { |
|
| 331 | + $module_data[ 'title' ] = '<a href="' . $module_data[ 'module_uri' ] |
|
| 332 | + . '">' . $module_data[ 'name' ] . '</a>'; |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | - if ( $module_data['author_uri'] && $module_data['author'] ) { |
|
| 336 | - $module_data['author'] = '<a href="' . $module_data['author_uri'] |
|
| 337 | - . '">' . $module_data['author'] . '</a>'; |
|
| 335 | + if ( $module_data[ 'author_uri' ] && $module_data[ 'author' ] ) { |
|
| 336 | + $module_data[ 'author' ] = '<a href="' . $module_data[ 'author_uri' ] |
|
| 337 | + . '">' . $module_data[ 'author' ] . '</a>'; |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | - $module_data['description'] = wptexturize( $module_data['description'] ); |
|
| 340 | + $module_data[ 'description' ] = wptexturize( $module_data[ 'description' ] ); |
|
| 341 | 341 | |
| 342 | - if ( $module_data['author'] ) { |
|
| 343 | - $module_data['description'] .= ' <cite>' |
|
| 342 | + if ( $module_data[ 'author' ] ) { |
|
| 343 | + $module_data[ 'description' ] .= ' <cite>' |
|
| 344 | 344 | // translators: Author name. |
| 345 | - . sprintf( __( 'By %s.', 'wordpoints' ), $module_data['author'] ) |
|
| 345 | + . sprintf( __( 'By %s.', 'wordpoints' ), $module_data[ 'author' ] ) |
|
| 346 | 346 | . '</cite>'; |
| 347 | 347 | } |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | } else { |
| 351 | 351 | |
| 352 | - $module_data['title'] = $module_data['name']; |
|
| 353 | - $module_data['author_name'] = $module_data['author']; |
|
| 352 | + $module_data[ 'title' ] = $module_data[ 'name' ]; |
|
| 353 | + $module_data[ 'author_name' ] = $module_data[ 'author' ]; |
|
| 354 | 354 | |
| 355 | 355 | } // End if ( $markup || $translate ) else. |
| 356 | 356 | |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | $module_data = wordpoints_get_module_data( $module_file, $markup, $translate ); |
| 476 | 476 | |
| 477 | - if ( empty( $module_data['name'] ) ) { |
|
| 477 | + if ( empty( $module_data[ 'name' ] ) ) { |
|
| 478 | 478 | continue; |
| 479 | 479 | } |
| 480 | 480 | |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | */ |
| 574 | 574 | function _wordpoints_sort_uname_callback( $a, $b ) { |
| 575 | 575 | |
| 576 | - return strnatcasecmp( $a['name'], $b['name'] ); |
|
| 576 | + return strnatcasecmp( $a[ 'name' ], $b[ 'name' ] ); |
|
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | /** |
@@ -691,7 +691,7 @@ discard block |
||
| 691 | 691 | |
| 692 | 692 | } else { |
| 693 | 693 | |
| 694 | - $current[] = $module; |
|
| 694 | + $current[ ] = $module; |
|
| 695 | 695 | sort( $current ); |
| 696 | 696 | update_option( 'wordpoints_active_modules', $current ); |
| 697 | 697 | } |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | $checked = array(); |
| 858 | 858 | |
| 859 | 859 | foreach ( $modules as $module ) { |
| 860 | - $checked[] = 'checked[]=' . $module; |
|
| 860 | + $checked[ ] = 'checked[]=' . $module; |
|
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | ob_start(); |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | $validate = wordpoints_validate_module( $module_file ); |
| 923 | 923 | |
| 924 | 924 | if ( is_wp_error( $validate ) ) { |
| 925 | - $errors[] = $module_file; |
|
| 925 | + $errors[ ] = $module_file; |
|
| 926 | 926 | continue; |
| 927 | 927 | } |
| 928 | 928 | |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | if ( ! $deleted ) { |
| 944 | - $errors[] = $module_file; |
|
| 944 | + $errors[ ] = $module_file; |
|
| 945 | 945 | } |
| 946 | 946 | } |
| 947 | 947 | |