| 413 | /** |
| 414 | * Allow overriding the themes returned. Passing a non-empty array will cause |
| 415 | * this function to exit early with that array of theme data. This can allow |
| 416 | * for more aggressive caching on installs with a large number of themes. |
| 417 | * |
| 418 | * @since 4.2.0 |
| 419 | * |
| 420 | * @param array $prepared_themes An associative array of theme data. |
| 421 | * @param string $current_theme The current theme slug. |
| 422 | * |
| 423 | * @return array Default empty array to skip, non-empty array to override. |
| 424 | */ |
| 425 | $prepared_themes = apply_filters( 'pre_wp_prepare_themes_for_js', $prepared_themes, $current_theme ); |
| 426 | if ( is_array( $prepared_themes ) && ! empty( $prepared_themes ) ) { |
| 427 | return $prepared_themes; |
| 428 | } |
| 429 | |