Download the PHP package carloswph/ilk without Composer
On this page you can find all versions of the php package carloswph/ilk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download carloswph/ilk
More information about carloswph/ilk
Files in carloswph/ilk
Package ilk
Short Description Custom Post Type and Custom Taxonomies helper for Wordpress.
License MIT
Informations about the package ilk
Ilk
Custom post types and custom taxonomies - one of the must-haves for any WP developer or web designers. They allow Wordpress websites to be turned into platforms, services and entire systems. There are thousands of ways of creating post types and taxonomies, and also a number of helper classes and wrappers. So, why do we need yet another?
Most post type helpers have something in common: they are not maintained. With Ilk, we come with a different proposal - to keep things always up-to-date, considering WP core, and launch new features and tools frequently.
Installation
Using Composer, of course: carloswph/ilk
, which is the recommended way.
But you can also clone this repo and require the classes files, located in the src/
folder, or even autoloading yourself, depending on the script you are using.
Usage
Yeah, we really try to keep things neat and simple. Ilk uses an Illuminati class named Pluralize, which allows you to submit just the singular post type (or taxonomy) name, and the script finds the equivalent plural in English. Perhaps we add some other languages in the future.
Regarding the logic, it is again pretty simple. All you need to do to create a new post type is instancing the Builder class, with the singular post type name:
Other class, TermBuilder, will allow you to create custom taxonomies for those post types you have just built. Logic, again, is quite simple: instatiating the class, using the singular name of the desired taxonomy as first argument and the custom post type class instance as second.
Other methods
Some other methods can be used. Commonly, we want the new post type menu to appear as submenu in a particular part of the backend. Sometimes, yet, we don't even want a menu to be shown. Both situations can be addressed with this method:
Also, as feature supports can be added anytime, they could be also removed, by using the following method: