← All changes
|
src/services/content-api/endpoints/class-endpoint-analytics-posts.php
+0
-10
3.19.2
→
3.24.2
View file →
| @@ -98,24 +98,16 @@ | ||
| 98 | 98 | * @return string The endpoint URL for the API request. |
| 99 | 99 | */ |
| 100 | 100 | public function get_endpoint_url( array $query_args = array() ): string { |
| 101 | 101 | // Store the values of the parameters requiring repeating keys. |
| 102 | - /** @var array<string> $authors */ | |
| 103 | - $authors = $query_args['author'] ?? array(); | |
| 104 | - | |
| 105 | 102 | /** @var array<string> $tags */ |
| 106 | 103 | $tags = $query_args['tag'] ?? array(); |
| 107 | 104 | |
| 108 | - /** @var array<string> $sections */ | |
| 109 | - $sections = $query_args['section'] ?? array(); | |
| 110 | - | |
| 111 | 105 | /** @var array<string> $urls */ |
| 112 | 106 | $urls = $query_args['urls'] ?? array(); |
| 113 | 107 | |
| 114 | 108 | // Remove the parameters requiring repeating keys. |
| 115 | - unset( $query_args['author'] ); | |
| 116 | 109 | unset( $query_args['tag'] ); |
| 117 | - unset( $query_args['section'] ); | |
| 118 | 110 | unset( $query_args['urls'] ); |
| 119 | 111 | |
| 120 | 112 | // Generate the endpoint URL. |
| 121 | 113 | $endpoint_url = parent::get_endpoint_url( $query_args ); |
| @@ -120,11 +112,9 @@ | ||
| 120 | 112 | // Generate the endpoint URL. |
| 121 | 113 | $endpoint_url = parent::get_endpoint_url( $query_args ); |
| 122 | 114 | |
| 123 | 115 | // Append the parameters requiring repeating keys to the endpoint URL. |
| 124 | - $endpoint_url = $this->append_same_key_params_to_url( $endpoint_url, $authors, 'author' ); | |
| 125 | 116 | $endpoint_url = $this->append_same_key_params_to_url( $endpoint_url, $tags, 'tag' ); |
| 126 | - $endpoint_url = $this->append_same_key_params_to_url( $endpoint_url, $sections, 'section' ); | |
| 127 | 117 | $endpoint_url = $this->append_same_key_params_to_url( $endpoint_url, $urls, 'url' ); |
| 128 | 118 | |
| 129 | 119 | return $endpoint_url; |
| 130 | 120 | } |