Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bvalosek/custom-post-type
A fluent-style wrapper for creating custom post types for Wordpress
https://github.com/bvalosek/custom-post-type
Last synced: 10 days ago
JSON representation
A fluent-style wrapper for creating custom post types for Wordpress
- Host: GitHub
- URL: https://github.com/bvalosek/custom-post-type
- Owner: bvalosek
- Created: 2013-05-27T20:33:12.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-30T15:05:57.000Z (over 11 years ago)
- Last Synced: 2024-04-29T21:10:30.982Z (8 months ago)
- Language: PHP
- Size: 114 KB
- Stars: 9
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fluent-style Custom Post Type for Wordpress
A simple [fluent API wrapper](http://en.wikipedia.org/wiki/Fluent_interface)
for creating custom post types in Wordpress.## Installing
All functionality is contained in the `CustomPostType` class in the
`CustomPostType.php` file. You can either copy it into an included class path
directory and use an
[autoloader](http://php.net/manual/en/language.oop5.autoload.php) or simply use
a `require_once()` call in your PHP file.## Usage
Assuming you're using a class autoloader
```php
slug('product')
->labels('Product', 'Products')
->custom_text_meta('Tagline')
->custom_text_meta('Product URL')
->menu_icon(plugin_dir_url(__FILE__) . 'img/store.png')
->supports(array('title', 'editor', 'thumbnail', 'revisions'))
->create();
```