Skip to content

Declare $wp_version; - #15

Open
nickbuddendotcom wants to merge 1 commit into
MatthewRuddy:masterfrom
nickbuddendotcom:patch-2
Open

Declare $wp_version;#15
nickbuddendotcom wants to merge 1 commit into
MatthewRuddy:masterfrom
nickbuddendotcom:patch-2

Conversation

@nickbuddendotcom

Copy link
Copy Markdown

At least on my local server, version_compare() doesn't work if I don't declare global $wp_version.

At least on my local server, version_compare() doesn't work if I don't declare global $wp_version.
@MatthewRuddy

Copy link
Copy Markdown
Owner

If you've just included the file containing the resizing code (such as in your theme's functions.php file), it should be fine. Provided the code isn't within a function, class, etc, it should be in the global namespace and not require any declaring of $wp_version.

@aristath

Copy link
Copy Markdown

I've had that error too on one of my installations and declaring $wp_version can't do any harm...
Better safe than sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants