I’m trying to validate WooCommerce subscriptions and I need the userid to do it but it keeps returning 0 from $current_user->ID.
<?php
include('../wp-load.php');
$current_user = wp_get_current_user();
$SubCheck = WC_Subscriptions_Manager::user_has_subscription( $current_user->ID, 9, 'active' );
?>
Try this way,why $current_user->ID
SEE:http://codex.wordpress.org/Function_Reference/get_current_user_id
EDIT:
EDIT2:
OR
thy this…