ai tools

Home » Snippets » ai tools
0

Created with:

Post Type Generator

Visibility: 

public

Creator: Kabucho

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
				/**
 * Registers a custom post type 'my_ai_tools'.
 *
 * @since 1.0.0
 *
 * @return void
 */
function wpturbo_register_my_custom_post_type() : void {
	$labels = [
		'name' => _x( 'AI Tools', 'Post Type General Name', 'wpturbo' ),
		'singular_name' => _x( 'AI Tool', 'Post Type Singular Name', 'wpturbo' ),
		'menu_name' => __( 'AI Tools', 'wpturbo' ),
		'name_admin_bar' => __( 'AI Tools', 'wpturbo' ),
		'archives' => __( 'AI Tools Archives', 'wpturbo' ),
		'attributes' => __( 'AI Tools Attributes', 'wpturbo' ),
		'parent_item_colon' => __( 'Parent AI Tool:', 'wpturbo' ),
		'all_items' => __( 'All AI Tools', 'wpturbo' ),
		'add_new_item' => __( 'Add New AI Tool', 'wpturbo' ),
		'add_new' => __( 'Add New', 'wpturbo' ),
		'new_item' => __( 'New AI Tool', 'wpturbo' ),
		'edit_item' => __( 'Edit AI Tool', 'wpturbo' ),
		'update_item' => __( 'Update AI Tool', 'wpturbo' ),
		'view_item' => __( 'View AI Tool', 'wpturbo' ),
		'view_items' => __( 'View AI Tools', 'wpturbo' ),
		'search_items' => __( 'Search AI Tools', 'wpturbo' ),
		'not_found' => __( 'AI Tool Not Found', 'wpturbo' ),
		'not_found_in_trash' => __( 'AI Tool Not Found in Trash', 'wpturbo' ),
		'featured_image' => __( 'Featured Image', 'wpturbo' ),
		'set_featured_image' => __( 'Set Featured Image', 'wpturbo' ),
		'remove_featured_image' => __( 'Remove Featured Image', 'wpturbo' ),
		'use_featured_image' => __( 'Use as Featured Image', 'wpturbo' ),
		'insert_into_item' => __( 'Insert into AI Tool', 'wpturbo' ),
		'uploaded_to_this_item' => __( 'Uploaded to this AI Tool', 'wpturbo' ),
		'items_list' => __( 'AI Tools List', 'wpturbo' ),
		'items_list_navigation' => __( 'AI Tools List Navigation', 'wpturbo' ),
		'filter_items_list' => __( 'Filter AI Tools List', 'wpturbo' ),
	];
	$labels = apply_filters( 'my_ai_tools-labels', $labels );

	$args = [
		'label' => __( 'AI Tool', 'wpturbo' ),
		'description' => __( 'My AI tools', 'wpturbo' ),
		'labels' => $labels,
		'supports' => [
			'title',
			'editor',
			'excerpt',
			'thumbnail',
			'page-attributes',
			'post-formats',
		],
		'hierarchical' => false,
		'public' => true,
		'show_ui' => true,
		'show_in_menu' => true,
		'menu_position' => 5,
		'menu_icon' => 'dashicons-backup',
		'show_in_admin_bar' => true,
		'show_in_nav_menus' => true,
		'publicly_queryable' => true,
		'query_var' => 'my_ai_tools',
		'exclude_from_search' => false,
		'has_archive' => 'ai_tools',
		'can_export' => true,
		'rewrite' => [
			'slug' => 'ai_tools',
			'with_front' => true,
			'pages' => true,
			'feeds' => false,
		],
		'capability_type' => 'page',
		'show_in_rest' => true,
	];
	$args = apply_filters( 'my_ai_tools-args', $args );

	register_post_type( 'my_ai_tools', $args );
}
add_action( 'init', 'wpturbo_register_my_custom_post_type', 0 );
			

Register an account to save your snippets or go Pro to get more features.