環境:
WooCommerce と WooCommerce サブスクリプションを備えた WordPress Web サイトを指定して、特定のユーザーのサブスクリプションのリストを取得しようとしています。最近の更新まで、この 1 行のコードでこれが処理されていました。これが私が使用しているコードです:
$all_user_subscriptions = WC_Subscriptions_Manager::get_users_subscriptions( $user_id );
$user_id は WordPress の有効なユーザー ID です。
問題:
前回の更新以降、次のエラーが頻繁に発生しています。
致命的なエラー: /home/warfarep/public_html/wp-content/plugins/woocommerce-subscriptions/includes/wcs-time-functions.php:332 でメッセージ「開始時間または終了時間は整数ではありません」を含むキャッチされない例外「InvalidArgumentException」 : #0 /home/warfarep/public_html/wp-content/plugins/woocommerce-subscriptions/includes/wcs-time-functions.php(309): wcs_number_of_leap_days('1456308046', 1487930566) #1 /home/warfarep/public_html/ wp-content/plugins/woocommerce-subscriptions/includes/wcs-deprecated-functions.php(171): wcs_estimate_periods_between('1456308046', 1487930566, '年', 'フロア') #2 /home/warfarep/public_html/wp- content/plugins/woocommerce-subscriptions/includes/class-wc-subscriptions-manager.php(1460):wcs_get_subscription_in_deprecated_structure(Object(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/plugins/woocommerce-subscriptions/includes/wcs- の /warfarep/public_html/wp-content/themes/warfare-plugins-pro-3/woocommerce/myaccount/my-account.ph 332 行目の time-functions.php
質問:
この関数が機能しなくなった (廃止された) 場合、致命的なエラーをスローせずに特定のユーザーのサブスクリプションのリスト (オブジェクト、配列など) を取得するにはどうすればよいですか?