feature: Initial commit

This commit is contained in:
Keith Solomon
2026-08-09 20:27:58 -05:00
commit 360fe48089
134 changed files with 14125 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
<?php
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Register Custom Post Type and Taxonomy
*
* @since 1.0.0
* @return void
*/
function projects_portfolio_register_cpt_and_taxonomy() {
register_post_type( 'projects', [
'labels' => [
'name' => esc_html__( 'Projects', 'projects-wp' ),
'singular_name' => esc_html__( 'Project', 'projects-wp' ),
'add_new_item' => esc_html__( 'Add New Project', 'projects-wp' ),
],
'public' => true,
'has_archive' => true,
'supports' => [ 'title', 'editor', 'thumbnail', 'excerpt' ],
'rewrite' => [ 'slug' => 'projects' ],
'show_in_rest' => true,
'menu_icon' => 'dashicons-format-gallery'
] );
register_taxonomy( 'project-type', 'projects', [
'labels' => [
'name' => esc_html__( 'Project Types', 'projects-wp' ),
'singular_name' => esc_html__( 'Project Type', 'projects-wp' ),
],
'hierarchical' => true,
'show_in_rest' => true,
'show_admin_column' => true,
'rewrite' => [
'slug' => 'project-type',
'with_front' => false,
],
] );
if ( ! term_exists( 'plugin', 'project_type' ) ) {
wp_insert_term( esc_html__( 'Plugin', 'projects-wp' ), 'project_type' );
}
if ( ! term_exists( 'theme', 'project_type' ) ) {
wp_insert_term( esc_html__( 'Theme', 'projects-wp' ), 'project_type' );
}
if ( ! term_exists( 'pattern', 'project_type' ) ) {
wp_insert_term( esc_html__( 'Pattern', 'projects-wp' ), 'project_type' );
}
}
add_action( 'init', 'projects_portfolio_register_cpt_and_taxonomy' );