2016-11-23 14 views
0

コンテキスト:WooCommerceとWooCommerceサブスクリプション付きのWordPressのウェブサイトを考えるWooCommerceサブスクリプションで特定のユーザーのサブスクリプションを取得するにはどうすればよいですか?

は、私は特定のユーザーのサブスクリプションのリストを取得しようとしています。最近のアップデートまで、この1行のコードは私のためにこれを世話しました。私が使っているコードは次のとおりです。

$all_user_subscriptions = WC_Subscriptions_Manager::get_users_subscriptions($user_id); 

ここで、$ user_idはWordPressの有効なユーザーのIDです。

問題:

我々は最後の更新以来、頻繁に、次のエラーが表示されます。

致命的なエラー:キャッチされない例外「InvalidArgumentException」をメッセージにして[スタートや終了時刻は整数ではありません '/スタックトレース:#0/home/warfarep/public_html/wp-content/plugins/woocommerce-subscriptions/includes:ホーム/ warfarep/public_html/wp-content/plugins/woocommerce-subscriptions/includes/wcs-time-functions.php:332 /wcs-time-functions.php(309):wcs_number_of_leap_days( '1456308046'、1487930566)#1/home/warfarep/public_html/wp-content/plugins/woocommerce-subscriptions/includes/wcs-deprecat wsc-content.php(171):wcs_estimate_periods_between( '1456308046'、1487930566、 'year'、 'floor')#2/home/warfarep/public_html/wp-content/plugins/woocommerce-subscriptions/includes/class-wc- subscriptions-manager.php(1460):wcs_get_subscription_in_deprecated_structure(オブジェクト(WC_Subscription))#3 /home/warfarep/public_html/wp-content/themes/warfare-plugins-pro-3/functions.php(334):WC_Subscriptions_Manager :: get_users_subscriptions ( '2686')#4 /home/warfarep/public_html/wp-content/themes/warfare-plugins-pro-3/woocommerce/myaccount/my-account.ph/home/warfarep/public_html/wp-content/pluginsにありますこの関数n場合

:ライン332

質問に/woocommerce-subscriptions/includes/wcs-time-functions.phpより長い仕事(廃止予定)致命的なエラーを投げずに、特定のユーザーの購読のリスト(オブジェクト、配列など)を取得するにはどうすればよいですか?

答えて

0

wcs_get_users_subscriptions($user_id)関数を使用してSubscriptionsオブジェクトを取得できると思います。

関連する問題