{"id":21813062,"url":"https://github.com/webdevstudios/cpt_core","last_synced_at":"2025-08-20T08:31:34.211Z","repository":{"id":11791447,"uuid":"14334370","full_name":"WebDevStudios/CPT_Core","owner":"WebDevStudios","description":"This is a helper class for creating custom post types.. I'm sure it doesn't cover everything. PRs welcome.","archived":false,"fork":false,"pushed_at":"2018-04-17T20:17:25.000Z","size":65,"stargazers_count":78,"open_issues_count":9,"forks_count":13,"subscribers_count":63,"default_branch":"master","last_synced_at":"2025-08-19T15:06:51.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebDevStudios.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-12T14:26:38.000Z","updated_at":"2025-08-01T10:49:02.000Z","dependencies_parsed_at":"2022-09-23T02:02:53.437Z","dependency_job_id":null,"html_url":"https://github.com/WebDevStudios/CPT_Core","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/WebDevStudios/CPT_Core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FCPT_Core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FCPT_Core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FCPT_Core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FCPT_Core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebDevStudios","download_url":"https://codeload.github.com/WebDevStudios/CPT_Core/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevStudios%2FCPT_Core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271287618,"owners_count":24733423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T14:26:58.926Z","updated_at":"2025-08-20T08:31:33.917Z","avatar_url":"https://github.com/WebDevStudios.png","language":"PHP","readme":"CPT_Core\n=========\n\nA tool to make custom post type registration just a bit simpler. Automatically registers post type labels and messages, and provides helpful methods.\n\nAlso see [Taxonomy_Core](https://github.com/jtsternberg/Taxonomy_Core).\n\n\u003ca href=\"https://webdevstudios.com/contact/\"\u003e\u003cimg src=\"https://webdevstudios.com/wp-content/uploads/2018/04/wds-github-banner.png\" alt=\"WebDevStudios. WordPress for big brands.\"\u003e\u003c/a\u003e\n\n#### The simple way:\n```php\n\u003c?php\n\n/**\n * Load CPT_Core.\n */\nrequire_once 'CPT_Core/CPT_Core.php';\n\n/**\n * Will register a 'Q \u0026 A' CPT\n */\nregister_via_cpt_core( array(\n\t__( 'Q \u0026 A', 'your-text-domain' ), // Singular\n\t__( 'Q \u0026 As', 'your-text-domain' ), // Plural\n\t'q-and-a-items' // Registered name/slug\n) );\n```\n\n#### The object-oriented way!\n```php\n\u003c?php\n\n/**\n * Load CPT_Core.\n */\nrequire_once 'CPT_Core/CPT_Core.php';\n\n/**\n * Creating a custom class allows you to override core methods, like CPT_Core::columns, and CPT_Core::columns_display\n */\nclass Actress_CPT extends CPT_Core {\n\n\t/**\n\t * Register Custom Post Types. See documentation in CPT_Core, and in wp-includes/post.php\n\t */\n\tpublic function __construct() {\n\n\t\t// Register this cpt\n\t\t// First parameter should be an array with Singular, Plural, and Registered name\n\t\tparent::__construct(\n\t\t\tarray( \n\t\t\t\t__( 'Actress', 'your-text-domain' ),\n\t\t\t\t__( 'Actresses', 'your-text-domain' ),\n\t\t\t\t'film-actress'\n\t\t\t),\n\t\t\tarray( \n\t\t\t\t'supports' =\u003e array( 'title', 'editor', 'excerpt', 'thumbnail' ), \n\t\t\t)\n\t\t);\n\n\t}\n\n\t/**\n\t * Registers admin columns to display. Hooked in via CPT_Core.\n\t * @since  0.1.0\n\t * @param  array  $columns Array of registered column names/labels\n\t * @return array           Modified array\n\t */\n\tpublic function columns( $columns ) {\n\t\t$new_column = array(\n\t\t\t'headshot' =\u003e sprintf( __( '%s Headshot', 'your-text-domain' ), $this-\u003epost_type( 'singular' ) ),\n\t\t);\n\t\treturn array_merge( $new_column, $columns );\n\t}\n\n\t/**\n\t * Handles admin column display. Hooked in via CPT_Core.\n\t * @since  0.1.0\n\t * @param  array  $column Array of registered column names\n\t */\n\tpublic function columns_display( $column, $post_id ) {\n\t\tswitch ( $column ) {\n\t\t\tcase 'headshot':\n\t\t\t\tthe_post_thumbnail();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n}\nnew Actress_CPT();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevstudios%2Fcpt_core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdevstudios%2Fcpt_core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevstudios%2Fcpt_core/lists"}