Make WordPress Core

Changeset 26008


Ignore:
Timestamp:
11/05/2013 12:23:38 AM (10 years ago)
Author:
wonderboymusic
Message:

When WordPress is loaded in a function (e.g. unit tests) the variables initialized at the top level aren't globals, but we expect them to be. Explicitly make the version variables global.

Props nbachiyski.
Fixes #23685.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/version.php

    r25944 r26008  
    11<?php
     2global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version;
     3
    24/**
    35 * The WordPress version string
  • trunk/src/wp-settings.php

    r25991 r26008  
    2121require( ABSPATH . WPINC . '/load.php' );
    2222require( ABSPATH . WPINC . '/default-constants.php' );
     23
     24/*
     25 * These can't be directly globalized in version.php. When updating,
     26 * we're including version.php from another install and don't want
     27 * these values to be overridden if already set.
     28 */
     29global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version;
    2330require( ABSPATH . WPINC . '/version.php' );
    2431
Note: See TracChangeset for help on using the changeset viewer.