Merge pull request #7521 from pjv/fix-BadMethodCallException
fix BadMethodCallException
This commit is contained in:
commit
5d715a4c0b
|
@ -481,7 +481,9 @@ class WC_Meta_Box_Product_Data {
|
|||
|
||||
foreach ( $product_ids as $product_id ) {
|
||||
$product = wc_get_product( $product_id );
|
||||
$json_ids[ $product_id ] = wp_kses_post( $product->get_formatted_name() );
|
||||
if ( is_object( $product ) ) {
|
||||
$json_ids[ $product_id ] = wp_kses_post( $product->get_formatted_name() );
|
||||
}
|
||||
}
|
||||
|
||||
echo esc_attr( json_encode( $json_ids ) );
|
||||
|
@ -494,7 +496,9 @@ class WC_Meta_Box_Product_Data {
|
|||
|
||||
foreach ( $product_ids as $product_id ) {
|
||||
$product = wc_get_product( $product_id );
|
||||
$json_ids[ $product_id ] = wp_kses_post( $product->get_formatted_name() );
|
||||
if ( is_object( $product ) ) {
|
||||
$json_ids[ $product_id ] = wp_kses_post( $product->get_formatted_name() );
|
||||
}
|
||||
}
|
||||
|
||||
echo esc_attr( json_encode( $json_ids ) );
|
||||
|
|
Loading…
Reference in New Issue