Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Addressing problem with Smashing Magazine's Custom Post Type

By: BobbyAdamson on Mar 17th, 2014  |  syntax: PHP  |  size: 0.54 KB  |  views: 160  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data