Make WordPress Core


Ignore:
Timestamp:
11/13/2022 01:49:16 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Docs: Document the usage of globals in some functions.

This affects:

  • the_block_editor_meta_boxes()
  • wp_generate_block_templates_export_file()
  • WP_oEmbed_Controller::get_proxy_item()

Follow-up to [44131], [48135], [51151], [53129].

Props krunal265.
Fixes #57082.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-template-utils.php

    r54817 r54831  
    12011201 * @since 6.0.0 Adds the whole theme to the export archive.
    12021202 *
     1203 * @global string $wp_version The WordPress version string.
     1204 *
    12031205 * @return WP_Error|string Path of the ZIP file or error on failure.
    12041206 */
    12051207function wp_generate_block_templates_export_file() {
     1208    global $wp_version;
     1209
    12061210    if ( ! class_exists( 'ZipArchive' ) ) {
    12071211        return new WP_Error( 'missing_zip_package', __( 'Zip Export not supported.' ) );
     
    12711275    // If a version is defined, add a schema.
    12721276    if ( $theme_json_raw['version'] ) {
    1273         global $wp_version;
    12741277        $theme_json_version = 'wp/' . substr( $wp_version, 0, 3 );
    12751278        $schema             = array( '$schema' => 'https://schemas.wp.org/' . $theme_json_version . '/theme.json' );
Note: See TracChangeset for help on using the changeset viewer.