Last active
June 7, 2017 12:46
-
-
Save sun/5d5b3658e09b40631feac308b81f1766 to your computer and use it in GitHub Desktop.
WordPress: How to add a namespace to procedural code (see diff between revisions)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Vendor\Mine; | |
function hook_name($value) { | |
return $value; | |
} | |
add_filter('hook_name', __NAMESPACE__ . '\hook_name'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment