highwind icon indicating copy to clipboard operation
highwind copied to clipboard

Undefined index notices when in WP_DEBUG for woocommerce integrations

Open vinnyusestrict opened this issue 8 years ago • 0 comments

I had to turn on WP_DEBUG for a moment and got several undefined index notices for includes/integrations/woocommerce/functions.php.

Basically you're trying to fetch data from $options when they don't exist. Ideally you'd check for isset() first.

function highwind_woocommerce_layout_classes( $classes ) {
    $options            = get_option( 'highwind_woocommerce_options' );
    $archive_fullwidth  = isset( $options['archive_fullwidth'] ) ? $options['archive_fullwidth'] : null;
    $details_fullwidth  = isset( $options['details_fullwidth'] ) ? $options['details_fullwidth'] : null;

Cheers, Vinny

vinnyusestrict avatar Mar 01 '16 16:03 vinnyusestrict