I am trying to get a list of all my subscribers in Woocommerce. I read about WC_Subscriptions_Manager :: get_subscription (), but I don't know how to use it. Please keep in mind that I have almost no knowledge of PHP.
Someone asked a similar question on the forum. I finally used the following code:
<?php if(isset($_REQUEST['Action']))
{
$Action = $_REQUEST['Action'];
switch($Action)
{
case "ValidateSubscription":
include('../../wp-load.php');
$Subscriptions = WC_Subscriptions_Manager::get_all_users_subscriptions();
print_r($Subscriptions);
break;
default:
echo "invalid action";
}
}else
{
echo "no action specified";
}
?>
How can i use it?
Thank you for your help!
source
share