public function add_subtitle_field($post) { if ($post->post_type == 'product') { global $post; $postID = $post->ID; $value = get_product_subtitle($postID); $pvalue = __('Subtitle', WCPS_TXT); echo '<div id="subtitlediv">'; echo '<label for="subtitle"><strong> ' . $pvalue . ' : </strong> </lable>'; echo '<input type="text" autocomplete="off" spellcheck="true" id="subtitle" size="50" name="product_subtitle" value="' . $value . '" placeholder="' . $pvalue . '">'; echo '</div>'; } }
public function get_subtitle($post_id) { $value = get_product_subtitle($post_id); return $value; }
function the_product_subtitle($id) { $value = get_product_subtitle($id); echo $value; }