<?php

    function custom_post_type(){


        foreach ($posts_type as $type) {

            $slug   = strtolower($type[0]);
            $labels = array(
                'name'               => _x($type[0], 'Post Type ' . $type[0], 'campaign'),
                'singular_name'      => _x($type[0], 'Post Type ' . $type[0], 'campaign'),
                'menu_name'          => __($type[1], 'campaign'),
                'parent_item_colon'  => __('Parent ' . $type[1], 'campaign'),
                'all_items'          => __('All ' . $type[1], 'campaign'),
                'view_item'          => __('View ' . $type[1], 'campaign'),
                'add_new_item'       => __('Add New ' . $type[0], 'campaign'),
                'add_new'            => __('Add New', 'campaign'),
                'edit_item'          => __('Edit ' . $type[0], 'campaign'),
                'update_item'        => __('Update ' . $type[0], 'campaign'),
                'search_items'       => __('Search ' . $type[1], 'campaign'),
                'not_found'          => __('Not Found', 'campaign'),
                'not_found_in_trash' => __('Not found in Trash', 'campaign'),
            );


            $args = array(
                'label'               => __($type[0], ''),
                'description'         => __($type[0], ''),
                'labels'              => $labels,
                'supports'            => $type[3],
                'taxonomies'          => array(),
                'hierarchical'        => false,
                'public'              => true,
                'show_ui'             => true,
                'show_in_menu'        => true,
                'show_in_nav_menus'   => true,
                'show_in_admin_bar'   => true,
                'menu_position'       => 5,
                'can_export'          => true,
                'has_archive'         => $type[2],
                'rewrite'             => array('slug' => $slug),
                'exclude_from_search' => false,
                'publicly_queryable'  => true,
                'capability_type'     => 'page',
            );

            register_post_type($type[0], $args);
        }
    }
    add_action( 'init', 'custom_post_type', 0 );
