{"id":19639534,"url":"https://github.com/jjgrainger/posttypes","last_synced_at":"2025-05-14T15:03:44.871Z","repository":{"id":10459119,"uuid":"65819493","full_name":"jjgrainger/PostTypes","owner":"jjgrainger","description":"Simple WordPress custom post types.","archived":false,"fork":false,"pushed_at":"2025-02-19T14:30:55.000Z","size":213,"stargazers_count":371,"open_issues_count":9,"forks_count":47,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-04T13:19:12.591Z","etag":null,"topics":["post-type","posttype","taxonomies","wordpress","wp"],"latest_commit_sha":null,"homepage":"https://posttypes.jjgrainger.co.uk/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jjgrainger.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-16T12:45:18.000Z","updated_at":"2025-03-25T19:31:07.000Z","dependencies_parsed_at":"2024-06-18T12:17:52.311Z","dependency_job_id":"cec63787-c405-48af-8303-46c0776d1e53","html_url":"https://github.com/jjgrainger/PostTypes","commit_stats":{"total_commits":139,"total_committers":13,"mean_commits":"10.692307692307692","dds":0.2086330935251799,"last_synced_commit":"d4825ddda6f502e66966c0fd9f7405dfa60a7442"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjgrainger%2FPostTypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjgrainger%2FPostTypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjgrainger%2FPostTypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjgrainger%2FPostTypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjgrainger","download_url":"https://codeload.github.com/jjgrainger/PostTypes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248465313,"owners_count":21108244,"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","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":["post-type","posttype","taxonomies","wordpress","wp"],"created_at":"2024-11-11T13:01:42.187Z","updated_at":"2025-04-11T19:07:05.090Z","avatar_url":"https://github.com/jjgrainger.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostTypes v2.2.1\n\n[![tests](https://github.com/jjgrainger/PostTypes/actions/workflows/tests.yml/badge.svg)](https://github.com/jjgrainger/PostTypes/actions/workflows/tests.yml) [![codecov](https://codecov.io/gh/jjgrainger/PostTypes/branch/master/graph/badge.svg?token=SGrK2xDF46)](https://codecov.io/gh/jjgrainger/PostTypes) [![Latest Stable Version](https://flat.badgen.net/github/release/jjgrainger/PostTypes/stable)](https://packagist.org/packages/jjgrainger/posttypes) [![Total Downloads](https://flat.badgen.net/packagist/dt/jjgrainger/PostTypes)](https://packagist.org/packages/jjgrainger/posttypes) [![License](https://flat.badgen.net/github/license/jjgrainger/PostTypes)](https://packagist.org/packages/jjgrainger/posttypes)\n\n\u003e Simple WordPress custom post types.\n\n## Requirements\n\n* PHP \u003e=7.2\n* [Composer](https://getcomposer.org/)\n* [WordPress](https://wordpress.org) \u003e=5.1\n\n## Installation\n\n#### Install with composer\n\nRun the following in your terminal to install PostTypes with [Composer](https://getcomposer.org/).\n\n```\n$ composer require jjgrainger/posttypes\n```\n\nPostTypes uses [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloading and can be used with the Composer's autoloader. Below is a basic example of getting started, though your setup may be different depending on how you are using Composer.\n\n```php\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse PostTypes\\PostType;\n\n$books = new PostType( 'book' );\n\n$books-\u003eregister();\n```\n\nSee Composer's [basic usage](https://getcomposer.org/doc/01-basic-usage.md#autoloading) guide for details on working with Composer and autoloading.\n\n## Basic Usage\n\nBelow is a basic example of setting up a simple book post type with a genre taxonomy. For more information, check out the [online documentation here](https://posttypes.jjgrainger.co.uk).\n\n```php\n// Require the Composer autoloader.\nrequire __DIR__ . '/vendor/autoload.php';\n\n// Import PostTypes.\nuse PostTypes\\PostType;\nuse PostTypes\\Taxonomy;\n\n// Create a book post type.\n$books = new PostType( 'book' );\n\n// Attach the genre taxonomy (which is created below).\n$books-\u003etaxonomy( 'genre' );\n\n// Hide the date and author columns.\n$books-\u003ecolumns()-\u003ehide( [ 'date', 'author' ] );\n\n// Set the Books menu icon.\n$books-\u003eicon( 'dashicons-book-alt' );\n\n// Register the post type to WordPress.\n$books-\u003eregister();\n\n// Create a genre taxonomy.\n$genres = new Taxonomy( 'genre' );\n\n// Set options for the taxonomy.\n$genres-\u003eoptions( [\n    'hierarchical' =\u003e false,\n] );\n\n// Register the taxonomy to WordPress.\n$genres-\u003eregister();\n```\n\n## Notes\n\n* The full documentation can be found online at [posttypes.jjgrainger.co.uk](https://posttypes.jjgrainger.co.uk)\n* The class has no methods for making custom fields for post types, use [Advanced Custom Fields](https://advancedcustomfields.com)\n* The book's example used in the README.md can be found in [examples/books.php](examples/books.php)\n* Licensed under the [MIT License](https://github.com/jjgrainger/PostTypes/blob/master/LICENSE)\n* Maintained under the [Semantic Versioning Guide](https://semver.org)\n\n## Author\n\n**Joe Grainger**\n\n* [https://jjgrainger.co.uk](https://jjgrainger.co.uk)\n* [https://twitter.com/jjgrainger](https://twitter.com/jjgrainger)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjgrainger%2Fposttypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjgrainger%2Fposttypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjgrainger%2Fposttypes/lists"}