Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPT Snippet #5

Open
mehmetkocali opened this issue Dec 19, 2023 · 0 comments
Open

CPT Snippet #5

mehmetkocali opened this issue Dec 19, 2023 · 0 comments

Comments

@mehmetkocali
Copy link

On one site I'm using Advanced Scripts for creating a CPT. Tried to switch it over to Fluent Snippets but the CPT snippet won't work.
Tried changing the priority to 1 didn't help either.

The code is as follows:

// Register Custom Post Type Kitaplar
function create_kitap_cpt() {

	$labels = array(
		'name' => _x( 'Kitaplar', 'Post Type General Name', 'focalhaus' ),
		'singular_name' => _x( 'Kitap', 'Post Type Singular Name', 'focalhaus' ),
		'menu_name' => _x( 'Kitaplar', 'Admin Menu text', 'focalhaus' ),
		'name_admin_bar' => _x( 'Kitap', 'Add New on Toolbar', 'focalhaus' ),
		'archives' => __( 'Kitap Arşivi', 'focalhaus' ),
		'attributes' => __( 'Kitap Özellikleri', 'focalhaus' ),
		'parent_item_colon' => __( 'Ana Kitap:', 'focalhaus' ),
		'all_items' => __( 'Tüm Kitaplar', 'focalhaus' ),
		'add_new_item' => __( 'Yeni Kitap Ekle', 'focalhaus' ),
		'add_new' => __( 'Yeni Ekle', 'focalhaus' ),
		'new_item' => __( 'Yeni Kitap', 'focalhaus' ),
		'edit_item' => __( 'Kitabı Düzenle', 'focalhaus' ),
		'update_item' => __( 'Kitabı Güncelle', 'focalhaus' ),
		'view_item' => __( 'Kitabı Görüntüle', 'focalhaus' ),
		'view_items' => __( 'Kitapları Görüntüle', 'focalhaus' ),
		'search_items' => __( 'Kitap Ara', 'focalhaus' ),
		'not_found' => __( 'Bulunamadı', 'focalhaus' ),
		'not_found_in_trash' => __( 'Geri Dönüşüm Kutusunda Bulunamadı', 'focalhaus' ),
		'featured_image' => __( 'Öne Çıkan Görsel', 'focalhaus' ),
		'set_featured_image' => __( 'Öne Çıkan Görseli Belirle', 'focalhaus' ),
		'remove_featured_image' => __( 'Öne Çıkan Görseli Kaldır', 'focalhaus' ),
		'use_featured_image' => __( 'Öne Çıkan Görsel Olarak Kullan', 'focalhaus' ),
		'insert_into_item' => __( 'Kitap Ekle', 'focalhaus' ),
		'uploaded_to_this_item' => __( 'Bu Kitaba Yüklendi', 'focalhaus' ),
		'items_list' => __( 'Kitapların Listesi', 'focalhaus' ),
		'items_list_navigation' => __( 'Kitaplar list navigation', 'focalhaus' ),
		'filter_items_list' => __( 'Filter Kitaplar list', 'focalhaus' ),
	);
	$args = array(
		'label' => __( 'Kitap', 'focalhaus' ),
		'description' => __( '', 'focalhaus' ),
		'labels' => $labels,
		'supports' => array('title', 'editor', 'thumbnail'),
		'taxonomies' => array(),
		'public' => true,
		'show_ui' => true,
		'show_in_menu' => true,
		'menu_position' => 5,
		'menu_icon' => 'dashicons-book',
		'show_in_admin_bar' => true,
		'show_in_nav_menus' => true,
		'can_export' => true,
		'has_archive' => true,
		'hierarchical' => false,
		'exclude_from_search' => false,
		'show_in_rest' => true,
		'publicly_queryable' => true,
		'capability_type' => 'post',
	);
	register_post_type( 'kitap', $args );
}
add_action( 'init', 'create_kitap_cpt', 0 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant