Custom plugin issue - Notice: Trying to get property of non-object in

by Rob D. A.   Last Updated September 14, 2018 14:08 PM

In my plugin to configure some basic values using a woocommerce function which is creating a select field, but for some reason it generate this error: "Notice: Trying to get property of non-object in /var/www/html/wp-content/plugins/woocommerce/includes/admin/wc-meta-box-functions.php on line 192"

It works but the error message on the screen driving me crazy. I can change value and save and everything is perfectly fine except the message.

function spinna360_nof($noi) {

woocommerce_wp_select( 
    array(
        'id'        => '_select_noi',
        'label'     => __( 'Select number of images: ', 'spinna360' ),
        'selected'  => true,
        'value'     =>  $noi,
        'options'   => [
            '24'        => __( '24', 'spinna360' ),
            '36'        => __( '36', 'spinna360' ),
            '48'        => __( '48', 'spinna360' )
            ]
        )
    );
}

Why? What is the problem?



Related Questions



How to edit shipping mode, adding to payment filter

Updated October 17, 2017 18:08 PM