Wordpress PHP警告:in_array()期望参数2是数组,布尔值

时间:2017-03-01 21:36:02

标签: php wordpress login error-handling

我刚升级了我们的服务器,它有最新版本的php。当用户尝试登录我们的网站时,我们收到以下错误:

The staging.ilovenz.me page isn’t working
staging.ilovenz.me didn’t send any data.
ERR_EMPTY_RESPONSE

我检查了日志文件,我们遇到以下错误:

[28-Feb-2017 22:23:33 UTC] PHP Warning:  in_array() expects parameter 2 to be array, boolean given in /mnt/stor14-wc1-dfw3/staging.ilovenz.me/web/content/wp-content/themes/kleo/lib/options.php on line 2416

在查看2416行的文件后,我可以看到以下功能,我不知道该怎么做...有些帮助会很棒!

if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {

    $sections[] = array(
        'icon'       => 'el-icon-shopping-cart',
        'icon_class' => 'icon-large',
        'title'      => __( 'Woocommerce', 'kleo_framework' ),
        'customizer' => false,
        'desc'       => '',
        'fields'     => array(
            array(
                'id'       => 'woo_sidebar',
                'type'     => 'select',
                'compiler' => true,
                'title'    => __( 'Woocommerce Pages Layout', 'kleo_framework' ),
                'subtitle' => __( 'Select the layout to use in Woocommerce pages.', 'kleo_framework' ),
                'options'  => array(
                    'default' => 'Default site layout',
                    'no'      => 'Full width',
                    'left'    => 'Left Sidebar',
                    'right'   => 'Right Sidebar',
                    '3lr'     => '3 Column, Left and Right Sidebars',
                    '3ll'     => '3 Column, 2 Left sidebars',
                    '3rr'     => '3 Column, 2 Right sidebars'
                ),
                'default'  => 'default'
            ),
            array(
                'id'       => 'woo_cat_sidebar',
                'type'     => 'select',
                'compiler' => true,
                'title'    => __( 'Woocommerce Category Layout', 'kleo_framework' ),
                'subtitle' => __( 'Select the layout to use in Woocommerce product listing pages.', 'kleo_framework' ),
                'options'  => array(
                    'default' => 'Default as set above',
                    'no'      => 'Full width',
                    'left'    => 'Left Sidebar',
                    'right'   => 'Right Sidebar',
                    '3lr'     => '3 Column, Left and Right Sidebars',
                    '3ll'     => '3 Column, 2 Left sidebars',
                    '3rr'     => '3 Column, 2 Right sidebars'
                ),
                'default'  => 'default'
            ),
            array(
                'id'       => 'woo_single_sidebar',
                'type'     => 'select',
                'compiler' => true,
                'title'    => __( 'Woocommerce Single Product Layout', 'kleo_framework' ),
                'subtitle' => __( 'Select the layout to use in Woocommerce single product pages.', 'kleo_framework' ),
                'options'  => array(
                    'default' => 'Default as set above',
                    'no'      => 'Full width',
                    'left'    => 'Left Sidebar',
                    'right'   => 'Right Sidebar',
                    '3lr'     => '3 Column, Left and Right Sidebars',
                    '3ll'     => '3 Column, 2 Left sidebars',
                    '3rr'     => '3 Column, 2 Right sidebars'
                ),
                'default'  => 'default'
            ),
            array(
                'id'       => 'woo_cart_location',
                'type'     => 'button_set',
                'title'    => __( 'Menu cart location', 'kleo_framework' ),
                'subtitle' => __( 'Shopping Cart in header menu location', 'kleo_framework' ),
                'options'  => array(
                    'off'       => 'Disabled',
                    'primary'   => 'Primary menu',
                    'secondary' => 'Secondary menu',
                    'top'       => 'Top menu'
                ),
                'default'  => 'primary'
            ),

            array(
                'id'       => 'woo_mobile_cart',
                'type'     => 'switch',
                'title'    => __( 'Mobile menu Cart Icon', 'kleo_framework' ),
                'subtitle' => __( 'This will show on mobile menu a shop icon with the number of cart items', 'kleo_framework' ),
                'default'  => '1' // 1 = checked | 0 = unchecked
            ),

            array(
                'id'       => 'woo_image_effect',
                'type'     => 'button_set',
                'title'    => __( 'Product image effect', 'kleo_framework' ),
                'subtitle' => __( 'The effect on products listing when hovering an image.', 'kleo_framework' ),
                'options'  => array(
                    'default' => 'Bottom-Top',
                    'fade'    => 'Fade',
                    'alt'     => 'Left-Right',
                    'single'  => 'No effect'
                ),
                'default'  => 'default'
            ),

            array(
                'id'       => 'woo_product_animate',
                'type'     => 'switch',
                'title'    => __( 'Enable product listing Appear Animation', 'kleo_framework' ),
                'subtitle' => __( 'On product listing the products will have a appear animation.', 'kleo_framework' ),
                'default'  => '1' // 1 = checked | 0 = unchecked
            ),

            array(
                'id'       => 'woo_percentage_badge',
                'type'     => 'switch',
                'title'    => __( 'Show percentage badge on products list', 'kleo_framework' ),
                'subtitle' => __( 'This will replace the "Sale" badge with "SAVE UP TO xx%"', 'kleo_framework' ),
                'default'  => '0' // 1 = checked | 0 = unchecked
            ),
            array(
                'id'       => 'woo_percent_color',
                'type'     => 'color',
                'required' => array( 'woo_percentage_badge', '=', '1' ),
                'title'    => __( 'Custom Badge color', 'kleo_framework' ),
                'subtitle' => '',
                'default'  => '#ffffff' // 1 = checked | 0 = unchecked
            ),
            array(
                'id'       => 'woo_percent_bg',
                'type'     => 'color',
                'required' => array( 'woo_percentage_badge', '=', '1' ),
                'title'    => __( 'Custom Badge Background', 'kleo_framework' ),
                'subtitle' => '',
                'default'  => '#000000' // 1 = checked | 0 = unchecked
            ),
            array(
                'id'      => 'woo_free_badge',
                'type'    => 'switch',
                'title'   => __( 'Show free badge on products list', 'kleo_framework' ),
                'default' => '1' // 1 = checked | 0 = unchecked
            ),

            array(
                'id'       => 'woo_new_badge',
                'type'     => 'switch',
                'title'    => __( 'Show NEW badge for new products added', 'kleo_framework' ),
                'subtitle' => '',
                'default'  => '1' // 1 = checked | 0 = unchecked
            ),
            array(
                'id'       => 'woo_show_excerpt_single',
                'type'     => 'switch',
                'title'    => __( 'Show excerpt on product page', 'kleo_framework' ),
                'subtitle' => '',
                'default'  => '0' // 1 = checked | 0 = unchecked
            ),
            array(
                'id'       => 'woo_product_navigation',
                'type'     => 'switch',
                'title'    => __( 'Enable product navigation', 'kleo_framework' ),
                'subtitle' => 'Display previous and next product navigation',
                'default'  => '1' // 1 = checked | 0 = unchecked
            ),
            array(
                'id'       => 'woo_buddypress_menus',
                'type'     => 'switch',
                'title'    => __( 'Manage account in Buddypress', 'kleo_framework' ),
                'subtitle' => __( 'Integrates "My Account" into Buddypress profile tabs', 'kleo_framework' ),
                'default'  => '1' // 1 = checked | 0 = unchecked
            ),
            array(
                'id'       => 'woo_new_days',
                'type'     => 'text',
                'required' => array( 'woo_new_badge', '=', '1' ),
                'title'    => __( 'Number of days to treat a product as new', 'kleo_framework' ),
                'subtitle' => __( 'For how many days to show the NEW badge once a product is added to the shop.', 'kleo_framework' ),
                'default'  => '7' // 1 = checked | 0 = unchecked
            ),

            array(
                'id'       => 'woo_catalog',
                'type'     => 'button_set',
                'title'    => __( 'Catalog mode', 'kleo_framework' ),
                'subtitle' => __( 'If you enable catalog mode will disable Add To Cart buttons, Checkout and Shopping cart.', 'kleo_framework' ),
                'options'  => array(
                    '0' => 'No',
                    '1' => 'Yes'
                ),
                'default'  => '0'
            ),
            array(
                'id'       => 'woo_disable_prices',
                'type'     => 'button_set',
                'title'    => __( 'Disable prices', 'kleo_framework' ),
                'subtitle' => __( 'Disable prices on category pages and product page', 'kleo_framework' ),
                'options'  => array(
                    '0' => 'No',
                    '1' => 'Yes'
                ),
                'required' => array( 'woo_catalog', '=', '1' ),
                'default'  => '0'
            ),
            array(
                'id'       => 'woo_shop_columns',
                'type'     => 'select',
                'title'    => __( 'Shop Products Columns', 'kleo_framework' ),
                'subtitle' => __( 'Select the number of columns to use for products display.', 'kleo_framework' ),
                'options'  => array(
                    '3' => '3',
                    '4' => '4',
                    '5' => '5',
                    '6' => '6'
                ),
                'default'  => '3'
            ),
            array(
                'id'       => 'woo_shop_products',
                'type'     => 'text',
                'title'    => __( 'Shop Products per page', 'kleo_framework' ),
                'subtitle' => __( 'How many products to show per page', 'kleo_framework' ),
                'default'  => '15' // 1 = checked | 0 = unchecked
            ),
            array(
                'id'       => 'woo_related_columns',
                'type'     => 'select',
                'title'    => __( 'Related Products number', 'kleo_framework' ),
                'subtitle' => __( 'Select the number of related products to show on product page.', 'kleo_framework' ),
                'options'  => array(
                    '3' => '3',
                    '4' => '4',
                    '5' => '5',
                    '6' => '6'
                ),
                'default'  => '3'
            ),
            array(
                'id'       => 'woo_upsell_columns',
                'type'     => 'select',
                'title'    => __( 'Upsell Products number', 'kleo_framework' ),
                'subtitle' => __( 'Select the number of upsell products to show on product page.', 'kleo_framework' ),
                'options'  => array(
                    '3' => '3',
                    '4' => '4',
                    '5' => '5',
                    '6' => '6'
                ),
                'default'  => '3'
            ),
            array(
                'id'       => 'woo_cross_columns',
                'type'     => 'select',
                'title'    => __( 'Cross-sell Products number', 'kleo_framework' ),
                'subtitle' => __( 'Select the number of Cross-sell products to show on cart page.', 'kleo_framework' ),
                'options'  => array(
                    '3' => '3',
                    '4' => '4',
                    '5' => '5',
                    '6' => '6'
                ),
                'default'  => '3'
            )
        )
    );
}

0 个答案:

没有答案