Merge pull request #14473 from woocommerce/fix/14470

Fix metabox logic.
This commit is contained in:
Mike Jolley 2017-04-18 10:34:34 +01:00 committed by GitHub
commit 1a2879d4e1
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@
</label>
<?php foreach ( self::get_product_type_options() as $key => $option ) :
if ( $product_object ) {
if ( metadata_exists( 'post', $post->ID, '_' . $key ) ) {
$selected_value = is_callable( array( $product_object, "is_$key" ) ) ? $product_object->{"is_$key"}() : 'yes' === get_post_meta( $post->ID, '_' . $key, true );
} else {
$selected_value = 'yes' === ( isset( $option['default'] ) ? $option['default'] : 'no' );