I have seen WordPress developers use two different methods for loading custom widgets from the functions.php file.
The first:
include("functions/my-custom-widget.php");
The second:
require_once(dirname(__FILE__) . "/functions/my-custom-widget.php");
Which one of these methods is more efficient. I’m particularly interested in performance if there is a difference at all. Does the require_once follow better ‘best practices’ ?
I’m sure there are plenty of other ways of doing this. If anyone has a better recommendation I would love to hear it.
Thanks.