1

I have made a plugin in which post meta required ? Now i get unwanted custom field. enter image description here Here is code that i am using to add custom meta in post type= recommendation

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);   

1 Answer 1

1

You can hide this in the screen options, there should be a checkbox for "Custom Fields"

2
  • Thanks, @ben Casey It just simple and i am finding it in codes of my website - smarthostingprice.com
    – shpwebhost
    Commented Mar 8, 2017 at 10:51
  • All good, we have all been there ;)
    – Ben Casey
    Commented Mar 8, 2017 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.