VideoHive

Add same metabox in Mutiple Custom Post Type *Wordpress

1213 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Microlancer Beta Tester
webdesignerart says
Hi guys i am bit stuck to add same meta box in multiple custom post type but its not work.
function avz_custom_meta_box() {

   // $post_types = get_post_types( array( 'public' => true ) );
   $post_types = get_post_types();
    foreach ( $post_types as $post_type ) {
        if ( $post_type == 'page' || $post_type =='post' )
            continue;
        add_meta_box( $prefix.'image', 'Header Image Upload Box', 'show_avz_custom_meta_box', $post_types, 'normal', 'high' );
    }
     // add_meta_box( $prefix.'image', 'Header Image Upload Box', 'show_avz_custom_meta_box', 'avanza_cp_page', 'normal', 'high' );
}
add_action('add_meta_boxes', 'avz_custom_meta_box');

But when give custom post id in String its works :(

1213 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Microlancer Beta Tester
webdesignerart says

Any one? :(

2984 posts
  • Community Superstar
  • Has been a member for 5-6 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Europe
+1 more
wickedpixel says

In add_meta_box line… isn’t there $post_type instead of $post_typeS?

123 posts
  • Has been a member for 1-2 years
mazoor says

Any one? :(

Talking about complaining after 7 minutes – you know this is not a Support Live Chat, right?

1213 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Microlancer Beta Tester
webdesignerart says

OMG , This little S ….. I am big Dumb, Thanks for your help Dude :)

by
by
by
by
by