Browse Source

Don't try to act on non-existent posts

master
Sam Black 3 years ago
parent
commit
627621d12d
Signed by: samwwwblack GPG Key ID: 0FF0223994EA47D8
  1. 4
      includes/class-wcqu-product-meta-box.php
  2. 4
      quantities-and-units.php

4
includes/class-wcqu-product-meta-box.php

@ -17,6 +17,10 @@ class WC_Quantities_and_Units_Quantity_Meta_Boxes {
public function meta_box_create() {
global $post, $woocommerce;
if (!isset($post) && !$post) {
return;
}
if ( $post->post_type == 'product' ) {
$product = wc_get_product( $post->ID );

4
quantities-and-units.php

@ -183,6 +183,10 @@ class WC_Quantities_and_Units {
global $post, $woocommerce;
if (!isset($post) && !$post) {
return;
}
// Regex doesn't like apostrophes in it.
$content = str_replace( "'", "\'", $post->post_content );
// Only display script if we are on a single product,

Loading…
Cancel
Save