Skip to content

Instantly share code, notes, and snippets.

@sun
Last active June 7, 2017 12:46
Show Gist options
  • Save sun/5d5b3658e09b40631feac308b81f1766 to your computer and use it in GitHub Desktop.
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)
<?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