Native ads custom post type
Custom post type for native ads
if ( ! function_exists('custom_post_type_native_ads') ) {
// Register Custom Post Type
function custom_post_type_native_ads() {
$labels = array(
'name' => _x( 'Native ads', 'Post Type General Name', 'native_ads' ),
'singular_name' => _x( 'Native ad', 'Post Type Singular Name', 'native_ads' ),
'menu_name' => __( 'Native ads', 'native_ads' ),
'name_admin_bar' => __( 'Native ad', 'native_ads' ),
'archives' => __( 'Item Archives', 'native_ads' ),
'parent_item_colon' => __( 'Parent Item:', 'native_ads' ),
'all_items' => __( 'Alla native ads', 'native_ads' ),
'add_new_item' => __( 'Skapa native ad', 'native_ads' ),
'add_new' => __( 'Skapa ny', 'native_ads' ),
'new_item' => __( 'Ny native ad', 'native_ads' ),
'edit_item' => __( 'Redigera native ad', 'native_ads' ),
'update_item' => __( 'Uppdatera native ad', 'native_ads' ),
'view_item' => __( 'Visa native ad', 'native_ads' ),
'search_items' => __( 'Sök native ad', 'native_ads' ),
'not_found' => __( 'Inget hittades', 'native_ads' ),
'not_found_in_trash' => __( 'Hittades inte i papperskorgen', 'native_ads' ),
'featured_image' => __( 'Utvald bild', 'native_ads' ),
'set_featured_image' => __( 'Välj utvald bild', 'native_ads' ),
'remove_featured_image' => __( 'Ta bort utvald bild', 'native_ads' ),
'use_featured_image' => __( 'Använd som utvald bild', 'native_ads' ),
'insert_into_item' => __( 'Lägg till', 'native_ads' ),
'uploaded_to_this_item' => __( 'Ladda upp', 'native_ads' ),
'items_list' => __( 'Lista', 'native_ads' ),
'items_list_navigation' => __( 'Items list navigation', 'native_ads' ),
'filter_items_list' => __( 'Filtrera lista', 'native_ads' ),
);
$rewrite = array(
'slug' => 'partnermedia',
'with_front' => true,
'pages' => true,
'feeds' => false,
);
$args = array(
'label' => __( 'Native ad', 'native_ads' ),
'description' => __( 'Custom post type for native ads', 'native_ads' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
'taxonomies' => array( 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-format-status',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'post',
);
register_post_type( 'native_ad', $args );
}
add_action( 'init', 'custom_post_type_native_ads', 0 );
}