metabox - Getting Custom Post Type Meta on Publish

Can you please take a look at this code and let me know why I am not able to get the Custom Post Meta on publishing the

Can you please take a look at this code and let me know why I am not able to get the Custom Post Meta on publishing the post. I tried thses

function get_cpt_meta($post_ID) {
 $post = get_post($post_ID);
 $meta = get_post_custom(); 
         $mfname = $meta['f_name'][0];
         $mlname = $meta['l_name'][0];
         echo $mfname. " " . $mlname;
}
add_action('publish_book', 'get_cpt_meta');

and

function get_cpt_meta($post_ID) {
 $post = get_post($post_ID);
 $meta = get_post_custom($post); 
         $mfname = $meta['f_name'][0];
         $mlname = $meta['l_name'][0];
         echo $mfname. " " . $mlname;
}
add_action('publish_book', 'get_cpt_meta');

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744923379a4601275.html

相关推荐

  • metabox - Getting Custom Post Type Meta on Publish

    Can you please take a look at this code and let me know why I am not able to get the Custom Post Meta on publishing the

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信