It’s because your require_once 'Pintlabs/Service/Untappd.php';
is relative to “current” file and should be absolute path. I don’t know where are you using this hook but depending on location it should look something like this:
-
ABSPATH
is your wordpress root dir and ‘custom-path’ should be a path to Pintlabs dir
require_once ABSPATH.'custom-path/'.'Pintlabs/Service/Untappd.php';
-
get_template_directory()
if you use it inside your theme (functions.php etc.). Notice the additional"https://wordpress.stackexchange.com/"
afterget_template_directory()
require_once get_template_directory().'/custom-path/'.'Pintlabs/Service/Untappd.php';
-
plugin_dir_path( __FILE__ )
when inside a plugin. You must use this function in your plugins main file like/my-plugin/my-plugin.php
or otherwise you get plugins subdirectory. It’s best to store it usingdefine()
in plugins main file.in
my-plugin/my-plugin.php
define("myplugin_dir",plugin_dir_path( __FILE__ ));
somewhere else
require_once myplugin_dir.'/Pintlabs/Service/Untappd.php';