-
Notifications
You must be signed in to change notification settings - Fork 1
chrisguitarguy/One-to-Many
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
One to Many =========== A poor man's post to posts. Overload WordPress' `post_parent` column for creating one to many (or many to one, if you prefer) relationships. Very light weight, but also very inflexible and not as full featured as something like Posts 2 Posts. Usage ----- Register a new post type, but pass in the `otm_parent` argument which should contain a string or array of post types which you want to to be "parents" of the post type being registered. <?php /** Plugin Name: Some Plugin */ add_action('init', function () { register_post_type('some_type', array( // other stuff here... // 'otm_parent' => 'page', 'otm_parent' => array('post', 'page'), )); });
About
A simple proof of concept for overloading `post_parent` to create one-to-many/many-to-one relationships. Like Posts 2 Posts but much, much worse.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published