Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Mushaf Post Type

Register Mushaf Post Type

// Register Custom Post Type
function mushafs_post_type() {

	$labels = array(
		'name'                  => _x( 'Mushafs', 'Post Type General Name', 'quran-library' ),
		'singular_name'         => _x( 'Mushaf', 'Post Type Singular Name', 'quran-library' ),
		'menu_name'             => __( 'Mushafs', 'quran-library' ),
		'name_admin_bar'        => __( 'Mushaf', 'quran-library' ),
		'archives'              => __( 'Mushaf Archives', 'quran-library' ),
		'attributes'            => __( 'Mushaf Attributes', 'quran-library' ),
		'parent_item_colon'     => __( 'Parent Mushaf:', 'quran-library' ),
		'all_items'             => __( 'All Mushaf', 'quran-library' ),
		'add_new_item'          => __( 'Add New Mushaf', 'quran-library' ),
		'add_new'               => __( 'Add New Mushaf', 'quran-library' ),
		'new_item'              => __( 'New Mushaf', 'quran-library' ),
		'edit_item'             => __( 'Edit Mushaf', 'quran-library' ),
		'update_item'           => __( 'Update Mushaf', 'quran-library' ),
		'view_item'             => __( 'View Mushaf', 'quran-library' ),
		'view_items'            => __( 'View Mushafs', 'quran-library' ),
		'search_items'          => __( 'Search Mushaf', 'quran-library' ),
		'not_found'             => __( 'No Mushafs Found', 'quran-library' ),
		'not_found_in_trash'    => __( 'No Mushaf Found in Trash', 'quran-library' ),
		'featured_image'        => __( 'Mushaf Featured Image', 'quran-library' ),
		'set_featured_image'    => __( 'Set Mushaf Featured Image', 'quran-library' ),
		'remove_featured_image' => __( 'Remove Mushaf Featured Image', 'quran-library' ),
		'use_featured_image'    => __( 'Use as Mushaf Featured Image', 'quran-library' ),
		'insert_into_item'      => __( 'Insert into Mushaf', 'quran-library' ),
		'uploaded_to_this_item' => __( 'Uploaded to this Mushaf', 'quran-library' ),
		'items_list'            => __( 'Mushafs list', 'quran-library' ),
		'items_list_navigation' => __( 'Mushafs List Navigation', 'quran-library' ),
		'filter_items_list'     => __( 'Filter Mushafs List', 'quran-library' ),
	);
	$args = array(
		'label'                 => __( 'Mushaf', 'quran-library' ),
		'description'           => __( 'Mushaf Post Type', 'quran-library' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail' ),
		'taxonomies'            => array( 'reciter', 'recitation', 'mushaf_type' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-book-alt',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'capability_type'       => 'post',
		'show_in_rest'          => true,
	);
	register_post_type( 'mushafs', $args );

}
add_action( 'init', 'mushafs_post_type', 0 );