Adding a meta_box to all Post Types

$post_types = get_post_types( array( '_builtin' => false ), 'objects' );  // Gets all custom types
       array_push( $post_types, get_post_type_object( 'post' ), get_post_type_object( 'page')  ); // Adds back the 'post' and 'page' types while ommitting attachments, revisions, menus, etc.
       foreach ( $post_types as $type ) {
               add_meta_box( . . . );
       }

Leave a Reply