Skip to content

Instantly share code, notes, and snippets.

@ddebernardy
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddebernardy/9425650 to your computer and use it in GitHub Desktop.
Save ddebernardy/9425650 to your computer and use it in GitHub Desktop.
WP define()
<?php
namespace Mesoconcepts\WordPress\Config;
/**
* Warning-free version of PHP's built-in \define() function.
*
* @param string $key
* @param mixed $value
* @param boolean $case_insensitive
*/
function define($key, $value, $case_insensitive = false) {
if (!\defined($key)) {
return \define($key, $value, $case_insensitive);
}
else {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment