@@ -427,29 +427,29 @@ discard block |
||
427 | 427 | } |
428 | 428 | |
429 | 429 | // Download the file |
430 | - $tmp = \download_url( $url ); |
|
430 | + $tmp = \download_url( $url ); |
|
431 | 431 | |
432 | - preg_match( '/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $url, $matches ); |
|
432 | + preg_match( '/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $url, $matches ); |
|
433 | 433 | |
434 | - $file_array['name'] = basename( $matches[0] ); |
|
435 | - $file_array['tmp_name'] = $tmp; |
|
434 | + $file_array['name'] = basename( $matches[0] ); |
|
435 | + $file_array['tmp_name'] = $tmp; |
|
436 | 436 | |
437 | - // Check for download errors |
|
438 | - if ( is_wp_error( $tmp ) ) { |
|
439 | - unlink( $file_array[ 'tmp_name' ] ); |
|
440 | - error_log( $tmp->get_error_message() ); |
|
441 | - } |
|
437 | + // Check for download errors |
|
438 | + if ( is_wp_error( $tmp ) ) { |
|
439 | + unlink( $file_array[ 'tmp_name' ] ); |
|
440 | + error_log( $tmp->get_error_message() ); |
|
441 | + } |
|
442 | 442 | |
443 | 443 | // Pull the image into the media library |
444 | - $image_id = media_handle_sideload( $file_array, $post_id ); |
|
444 | + $image_id = media_handle_sideload( $file_array, $post_id ); |
|
445 | 445 | |
446 | - // Check for handle sideload errors. |
|
447 | - if ( is_wp_error( $image_id ) ) { |
|
448 | - unlink( $file_array['tmp_name'] ); |
|
449 | - error_log( $image_id->get_error_message() ); |
|
450 | - } |
|
446 | + // Check for handle sideload errors. |
|
447 | + if ( is_wp_error( $image_id ) ) { |
|
448 | + unlink( $file_array['tmp_name'] ); |
|
449 | + error_log( $image_id->get_error_message() ); |
|
450 | + } |
|
451 | 451 | |
452 | - return apply_filters( "tc_image_data", $image_id ); |
|
452 | + return apply_filters( "tc_image_data", $image_id ); |
|
453 | 453 | |
454 | 454 | } |
455 | 455 | |
@@ -472,9 +472,9 @@ discard block |
||
472 | 472 | |
473 | 473 | // If our cURL failed |
474 | 474 | if ( $curl_response === false ) { |
475 | - $info = curl_getinfo( $curl ); |
|
476 | - curl_close( $curl ); |
|
477 | - die( 'error occured during curl exec. Additional info: ' . var_export( $info ) ); |
|
475 | + $info = curl_getinfo( $curl ); |
|
476 | + curl_close( $curl ); |
|
477 | + die( 'error occured during curl exec. Additional info: ' . var_export( $info ) ); |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | curl_close( $curl ); |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | $char = "0123456789abcdefghijklmnopqrstuvwxyz"; |
621 | 621 | |
622 | 622 | $user_length = mt_rand( 5, 20 ); |
623 | - $domain_length = mt_rand( 7, 12 ); |
|
623 | + $domain_length = mt_rand( 7, 12 ); |
|
624 | 624 | |
625 | 625 | for ( $i = 1; $i <= $user_length; $i++ ){ |
626 | 626 | $user .= substr( $char, mt_rand( 0, strlen( $char ) ), 1 ); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | return; |
29 | 29 | } |
30 | 30 | |
31 | - $class = str_replace( __NAMESPACE__ . '\\', '', $class ); |
|
31 | + $class = str_replace( __NAMESPACE__ . '\\', '', $class ); |
|
32 | 32 | |
33 | 33 | $nss = array( |
34 | 34 | 'Abstracts', |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | ); |
38 | 38 | |
39 | 39 | if ( in_array( $namespace[1], $nss ) ){ |
40 | - $class = strtolower( preg_replace( '/(?<!^)([A-Z])/', '/\1', $class ) ); |
|
41 | - $class = str_replace( '\\', '', $class ); |
|
42 | - $file = dirname( __FILE__ ) . '/' . $class . '.php'; |
|
43 | - } else { |
|
44 | - $class = strtolower( preg_replace( '/(?<!^)([A-Z])/', '-\\1', $class ) ); |
|
45 | - $file = dirname( __FILE__ ) . '/includes/class-' . $class . '.php'; |
|
46 | - } |
|
40 | + $class = strtolower( preg_replace( '/(?<!^)([A-Z])/', '/\1', $class ) ); |
|
41 | + $class = str_replace( '\\', '', $class ); |
|
42 | + $file = dirname( __FILE__ ) . '/' . $class . '.php'; |
|
43 | + } else { |
|
44 | + $class = strtolower( preg_replace( '/(?<!^)([A-Z])/', '-\\1', $class ) ); |
|
45 | + $file = dirname( __FILE__ ) . '/includes/class-' . $class . '.php'; |
|
46 | + } |
|
47 | 47 | |
48 | 48 | if ( is_readable( $file ) ) { |
49 | 49 | require_once( $file ); |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | // Register hook providers and views. |
83 | 83 | plugin()->register_hooks( new AdminPage() ) |
84 | 84 | ->register_hooks( new Ajax() ) |
85 | - ->register_view( new Views\Posts() ) |
|
86 | - ->register_view( new Views\Terms() ) |
|
85 | + ->register_view( new Views\Posts() ) |
|
86 | + ->register_view( new Views\Terms() ) |
|
87 | 87 | ->register_view( new Views\Various() ) |
88 | 88 | ->register_type( new Types\Post() ) |
89 | 89 | ->register_type( new Types\Term() ); |
@@ -276,7 +276,7 @@ |
||
276 | 276 | $post_types = get_post_types( array( 'public' => true ), 'objects' ); |
277 | 277 | foreach ( $post_types as $post_type ) : |
278 | 278 | |
279 | - return $this->delete( $post_type->name ); |
|
279 | + return $this->delete( $post_type->name ); |
|
280 | 280 | |
281 | 281 | endforeach; |
282 | 282 |