我已经制作了一个插件,其中需要post meta?现在我得到了不需要的自定义字段。下面是我用来在post type=recommendation中添加自定义meta的代码
add_meta_box(\'plugin-recommendation-box\', \'Recommendation\', \'add_plugin_recommendation_box\', \'recommendations\', \'normal\', \'default\');
function add_plugin_recommendation_box(){
global $post;
$title = get_post_meta($post->ID, \'recommendation_title1\', true);
$price = get_post_meta($post->ID, \'recommendation_price\', true);
$reg_price = get_post_meta($post->ID, \'recommendation_reg_price\', true);
$rating= get_post_meta($post->ID, \'recommendation_rating\', true);
$pros=get_post_meta($post->ID, \'recommendation_pros\', true);
$cons=get_post_meta($post->ID, \'recommendation_cons\', true);
$specs=get_post_meta($post->ID, \'recommendation_specs\', true);
$url=get_post_meta($post->ID, \'recommendation_url\', true);
$custom_url=get_post_meta($post->ID, \'custom_url\', true);
$rec_short_dec=get_post_meta($post->ID, \'rec_short_dec\', true);
$ratings=get_post_meta($post->ID, \'recommendation_ratings\', true);
$trybtn=get_post_meta($post->ID, \'recommendation_trybtn\', true);
$curr=get_post_meta($post->ID, \'recommendation_currency\', true);
$compare_subtitle=get_post_meta($post->ID, \'compare_subtitle\', true);
$compare_price_1=get_post_meta($post->ID, \'compare_price_1\', true);
$compare_price_2=get_post_meta($post->ID, \'compare_price_2\', true);
$compare_price_3=get_post_meta($post->ID, \'compare_price_3\', true);
$compare_price_4=get_post_meta($post->ID, \'compare_price_4\', true);
$compare_price_plan_1=get_post_meta($post->ID, \'compare_price_plan_1\', true);
$compare_price_plan_2=get_post_meta($post->ID, \'compare_price_plan_2\', true);
$compare_price_plan_3=get_post_meta($post->ID, \'compare_price_plan_3\', true);
$compare_price_plan_4=get_post_meta($post->ID, \'compare_price_plan_4\', true);
$compare_price_plan_short_desc=get_post_meta($post->ID, \'compare_price_plan_short_desc\', true);
$compare_price_short_desc=get_post_meta($post->ID, \'compare_price_short_desc\', true);
$offer_price_short_desc=get_post_meta($post->ID, \'offer_price_short_desc\', true);
$offer_sale_text=get_post_meta($post->ID, \'offer_sale_text\', true);
$offer_image=get_post_meta($post->ID, \'offer_image\', true);
$offer_subtitle_text=get_post_meta($post->ID, \'offer_subtitle_text\', true);
$coupon_code=get_post_meta($post->ID, \'coupon_code\', true);
$coupon_detail=get_post_meta($post->ID, \'coupon_detail\', true);
$coupon_start_date=get_post_meta($post->ID, \'coupon_start_date\', true);
$coupon_end_date=get_post_meta($post->ID, \'coupon_end_date\', true);
$top_10_basic_feature1=get_post_meta($post->ID, \'top_10_basic_feature1\', true);
$top_10_basic_feature2=get_post_meta($post->ID, \'top_10_basic_feature2\', true);
$top_10_basic_feature3=get_post_meta($post->ID, \'top_10_basic_feature3\', true);
$top_10_basic_feature4=get_post_meta($post->ID, \'top_10_basic_feature4\', true);
$top_10_basic_feature5=get_post_meta($post->ID, \'top_10_basic_feature5\', true);
$top_10_advance_feature1=get_post_meta($post->ID, \'top_10_advance_feature1\', true);
$top_10_advance_feature2=get_post_meta($post->ID, \'top_10_advance_feature2\', true);
$top_10_advance_feature3=get_post_meta($post->ID, \'top_10_advance_feature3\', true);
$top_10_advance_feature4=get_post_meta($post->ID, \'top_10_advance_feature4\', true);
$top_10_advance_feature5=get_post_meta($post->ID, \'top_10_advance_feature5\', true);
$rec_expert_feature1=get_post_meta($post->ID, \'rec_expert_feature1\', true);
$rec_expert_feature2=get_post_meta($post->ID, \'rec_expert_feature2\', true);
$expert_feature1_title=get_post_meta($post->ID, \'expert_feature1_title\', true);
$expert_feature2_title=get_post_meta($post->ID, \'expert_feature2_title\', true);
$expert_trend=get_post_meta($post->ID, \'expert_trend\', true);
$sch_popup_feature1=get_post_meta($post->ID, \'sch_popup_feature1\', true);
$sch_popup_feature2=get_post_meta($post->ID, \'sch_popup_feature2\', true);