• Hello! I’m currently unable to delete content in the Size Chart field, I can only update the content.

    I tracked this bug down to class-printful-size-chart-tab.php on line 127:

    //save
    if (!empty($_POST['pf_size_chart'])) {
    	update_post_meta($post_id, 'pf_size_chart', htmlspecialchars($_POST['pf_size_chart']));
    }

    This code is basically saying “Only update the field if there’s content”. If you delete the content, nothing is going to happen.

    It should be:

    //save
    if (!empty($_POST['pf_size_chart'])) {
    	update_post_meta($post_id, 'pf_size_chart', htmlspecialchars($_POST['pf_size_chart']));
    } else {
    	delete_post_meta($post_id, 'pf_size_chart');
    }

    This will delete the content if it’s empty. 🙂

    Thank you!

  • The topic ‘Unable to delete Size Chart field’ is closed to new replies.