【发布时间】:2017-08-14 21:31:13
【问题描述】:
我在使用 wordpress 时遇到了非法字符串偏移量 'qty' 的问题,我不知道如何解决。
非法的字符串偏移量'qty' public_html/wp-content/themes/freelancersvalley/includes/aecore/payments.php 在第 70 行
代码:
function ae_user_package_info($user_ID) {
if (!$user_ID) return;
global $ae_post_factory;
$ae_pack = $ae_post_factory->get('pack');
$packs = $ae_pack->fetch();
$orders = AE_Payment::get_current_order($user_ID);
$package_data = AE_Package::get_package_data($user_ID);
foreach ($packs as $package) {
$sku = $package->sku;
if (isset($package_data[$sku]) && $package_data[$sku]['qty'] > 0) {
if( $package->post_type == 'pack'){
$order = get_post($orders[$sku]);
if (!$order || is_wp_error($order) || !in_array($order->post_status, array('publish', 'pending'))) continue;
/**
* print text when company has job left in package
*/
?>
<p>
错在哪里?
【问题讨论】:
-
print_r($package_data);里面有数量吗?
标签: php wordpress string offset