I have this structure on my website:
And inside the game folder (the index.php
file) I'm trying to call WooCommerce and WordPress functions, to see if the user has a membership (I'm using WooCommerce Membership plugin).
With this code:
require_once('../wp-load.php' );
if (wc_memberships_is_post_content_restricted($id) && !wc_memberships_is_user_member() && !current_user_can('administrator')) {
header("Location: https:/localhost/mywebsite");
}
wc_memberships_is_post_content_restricted();
is a WooCommerce Membership function... on the localserver (wampserver) it's working, but when I try to run on my online host the functions do not work.
I also used var_dump( get_defined_functions() );
to see if the functions are properly load, and it's...