SHARE
TWEET

Addressing problem with Smashing Magazine's Custom Post Type

BobbyAdamson Mar 17th, 2014 278 Never
  1. function product_price_box_content( $post ) {
  2.     wp_nonce_field( plugin_basename( __FILE__ ), 'product_price_box_content_nonce' );
  3.     $meta_values = get_post_meta($post->ID, 'product_price', true);
  4.  
  5.     echo '<label for="product_price"></label>';
  6.     if($meta_values != '') {
  7.         echo '<input type="text" id="product_price" name="product_price" placeholder="enter a price" value="' . $meta_values . '"/>';
  8.     } else {
  9.         echo '<input type="text" id="product_price" name="product_price" placeholder="enter a price"/>';
  10.     }
  11. }
RAW Paste Data
Top