I have inserted values product-price, name and size in wordpress. The insert code is below
function products_save_postdata($post_id) {
if (isset ($_POST['price'])) {
update_post_meta($post_id, 'price', esc_attr($_POST['price']));
}
if (isset ($_POST['product_name'])) {
update_post_meta($post_id, 'product_name', esc_attr($_POST['product_name']));
}
if (isset ($_POST['size'])) {
update_post_meta($post_id, 'size', esc_attr($_POST['size']));
}
}
How can i fetch this inserted data?
You can use this function instead of yours:
Get values with: