equal
deleted
inserted
replaced
12 * |
12 * |
13 * This uses Core's HTTP API to make requests, which gives plugins the ability |
13 * This uses Core's HTTP API to make requests, which gives plugins the ability |
14 * to hook into the process. |
14 * to hook into the process. |
15 * |
15 * |
16 * @since 2.8.0 |
16 * @since 2.8.0 |
17 * |
|
18 * @see SimplePie_File |
|
19 */ |
17 */ |
|
18 #[AllowDynamicProperties] |
20 class WP_SimplePie_File extends SimplePie_File { |
19 class WP_SimplePie_File extends SimplePie_File { |
|
20 |
|
21 /** |
|
22 * Timeout. |
|
23 * |
|
24 * @var int How long the connection should stay open in seconds. |
|
25 */ |
|
26 public $timeout = 10; |
21 |
27 |
22 /** |
28 /** |
23 * Constructor. |
29 * Constructor. |
24 * |
30 * |
25 * @since 2.8.0 |
31 * @since 2.8.0 |
54 |
60 |
55 if ( ! empty( $this->headers ) ) { |
61 if ( ! empty( $this->headers ) ) { |
56 $args['headers'] = $this->headers; |
62 $args['headers'] = $this->headers; |
57 } |
63 } |
58 |
64 |
59 if ( SIMPLEPIE_USERAGENT != $this->useragent ) { // Use default WP user agent unless custom has been specified. |
65 if ( SIMPLEPIE_USERAGENT !== $this->useragent ) { // Use default WP user agent unless custom has been specified. |
60 $args['user-agent'] = $this->useragent; |
66 $args['user-agent'] = $this->useragent; |
61 } |
67 } |
62 |
68 |
63 $res = wp_safe_remote_request( $url, $args ); |
69 $res = wp_safe_remote_request( $url, $args ); |
64 |
70 |