Unfortunately, including it under function.php causes an error “There was a critical error on your site.”
WP (wp.hooks.addFilter) is causing an error !?!
Here is the log for the error:
AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Undefined constant “wp” in /…/wp-content/themes/…/functions.php:102\n
Stack trace:\n#0 /…/wp-settings.php(585): include()\n#1 /…/wp-config.php(121): require_once(‘…’)\n#2 /…/wp-load.php(50): require_once(‘…’)\n#3 /…/wp-blog-header.php(13): require_once(‘…’)\n#4 /…/index.php(17): require(‘…’)\n#5 {main}\n thrown in /…/wp-content/themes/pa-smedia/functions.php on line 102′, referer: …