130 |
130 |
131 /** |
131 /** |
132 * Filters API request arguments for each Install Themes screen tab. |
132 * Filters API request arguments for each Install Themes screen tab. |
133 * |
133 * |
134 * The dynamic portion of the hook name, `$tab`, refers to the theme install |
134 * The dynamic portion of the hook name, `$tab`, refers to the theme install |
135 * tabs. Default tabs are 'dashboard', 'search', 'upload', 'featured', |
135 * tab. |
136 * 'new', and 'updated'. |
136 * |
|
137 * Possible hook names include: |
|
138 * |
|
139 * - `install_themes_table_api_args_dashboard` |
|
140 * - `install_themes_table_api_args_featured` |
|
141 * - `install_themes_table_api_args_new` |
|
142 * - `install_themes_table_api_args_search` |
|
143 * - `install_themes_table_api_args_updated` |
|
144 * - `install_themes_table_api_args_upload` |
137 * |
145 * |
138 * @since 3.7.0 |
146 * @since 3.7.0 |
139 * |
147 * |
140 * @param array|false $args Theme install API arguments. |
148 * @param array|false $args Theme install API arguments. |
141 */ |
149 */ |
146 } |
154 } |
147 |
155 |
148 $api = themes_api( 'query_themes', $args ); |
156 $api = themes_api( 'query_themes', $args ); |
149 |
157 |
150 if ( is_wp_error( $api ) ) { |
158 if ( is_wp_error( $api ) ) { |
151 wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try Again' ) . '</a>' ); |
159 wp_die( '<p>' . $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try Again' ) . '</a></p>' ); |
152 } |
160 } |
153 |
161 |
154 $this->items = $api->themes; |
162 $this->items = $api->themes; |
155 |
163 |
156 $this->set_pagination_args( |
164 $this->set_pagination_args( |
244 * @global array $themes_allowedtags |
252 * @global array $themes_allowedtags |
245 * |
253 * |
246 * @param object $theme { |
254 * @param object $theme { |
247 * An object that contains theme data returned by the WordPress.org API. |
255 * An object that contains theme data returned by the WordPress.org API. |
248 * |
256 * |
249 * @type string $name Theme name, e.g. 'Twenty Twenty'. |
257 * @type string $name Theme name, e.g. 'Twenty Twenty-One'. |
250 * @type string $slug Theme slug, e.g. 'twentytwenty'. |
258 * @type string $slug Theme slug, e.g. 'twentytwentyone'. |
251 * @type string $version Theme version, e.g. '1.1'. |
259 * @type string $version Theme version, e.g. '1.1'. |
252 * @type string $author Theme author username, e.g. 'melchoyce'. |
260 * @type string $author Theme author username, e.g. 'melchoyce'. |
253 * @type string $preview_url Preview URL, e.g. 'https://2020.wordpress.net/'. |
261 * @type string $preview_url Preview URL, e.g. 'https://2021.wordpress.net/'. |
254 * @type string $screenshot_url Screenshot URL, e.g. 'https://wordpress.org/themes/twentytwenty/'. |
262 * @type string $screenshot_url Screenshot URL, e.g. 'https://wordpress.org/themes/twentytwentyone/'. |
255 * @type float $rating Rating score. |
263 * @type float $rating Rating score. |
256 * @type int $num_ratings The number of ratings. |
264 * @type int $num_ratings The number of ratings. |
257 * @type string $homepage Theme homepage, e.g. 'https://wordpress.org/themes/twentytwenty/'. |
265 * @type string $homepage Theme homepage, e.g. 'https://wordpress.org/themes/twentytwentyone/'. |
258 * @type string $description Theme description. |
266 * @type string $description Theme description. |
259 * @type string $download_link Theme ZIP download URL. |
267 * @type string $download_link Theme ZIP download URL. |
260 * } |
268 * } |
261 */ |
269 */ |
262 public function single_row( $theme ) { |
270 public function single_row( $theme ) { |