Make WordPress Core


Ignore:
Timestamp:
06/16/2023 08:06:30 AM (16 months ago)
Author:
oandregal
Message:

Themes: add wp_get_remote_theme_patterns function.

Adds a new public function, wp_get_remote_theme_patterns to query the patterns datum from theme.json and substitutes current usage of private APIs.

Props ntsekouras, poena, audrasjb.
Fixes #58460

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/global-styles-and-settings.php

    r55711 r55926  
    427427    WP_Theme_JSON_Resolver::clean_cached_data();
    428428}
     429
     430/**
     431 * Returns the current theme's wanted patterns (slugs) to be
     432 * registered from Pattern Directory.
     433 *
     434 * @since 6.3.0
     435 *
     436 * @return string[]
     437 */
     438function wp_get_remote_theme_patterns() {
     439    return WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_patterns();
     440}
Note: See TracChangeset for help on using the changeset viewer.