Is there a way to call functions from a default location for multiple installed sites on the same server?
\public_html\functions\global_functions.php has the shared functions for all sites.
\public_html\site1\wp-content\themes\theme1_child\functions.php require_once( dirname(__FILE__) . '../../../../global_functions.php'); \public_html\site2\wp-content\themes\theme1_child\functions.php require_once( dirname(__FILE__) . '../../../../global_functions.php');
I know this is not correct but I am not sure if it is even possible to do something like this. Since it is on the same server, I didn't know if there was a way to see other directories above the current install point.
After continuing to play with this, I ended up doing it this way:
define ( 'global_functions_dir', dirname(__FILE__) . '../../../../../_functions' ); require_once( global_functions_dir . '/global-functions.php');
which can be added on each site to include the necessary functions. If anyone knows if there are any security risks doing it this way, please let me know. Since this is a server-side call, I would think this is fine??
I have started reading through the multi-site configuration and this could be a great way to accomplish this. I will look at moving in this direction after I have a better understanding of the issues that might arise by doing so. Thank you for your help.