Skip to content
This repository was archived by the owner on May 2, 2024. It is now read-only.

10up/term-data-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Term Data Store

Create a one-to-one relationships between posts and terms and keep them in sync.

Support Level MIT License

Caution

As of 12 April 2024, this project is archived and no longer being actively maintained.

How to Use

1. Register a custom post type

$post_type_name    = 'show_pt';
$post_type_options = array();

register_post_type(
	$post_type_name, $post_type_options
);

2. Register a taxonomy

$taxonomy_name      = 'show_tax';
$taxonomy_options   = array();
$post_types         = array( 'post' );

register_taxonomy(
	$taxonomy_name, $post_types, $taxonomy_options
);

3. Create the relationship between the post type and taxonomy

\TDS\add_relationship( $post_type_name, $taxonomy_name );

4. Create a post or term

Creating a post named "The Tick" in the post type will create a corresponding term named "The Tick" in the taxonomy. The reverse will happen if you create a term in the taxonomy.

Unit Tests

TDS has a full suite of unit tests to verify expected behavior. To run them, you'll first need to install the composer dependencies:

composer update

Once you have those installed, run phpunit:

vendor/bin/phpunit

Support Level

Archived: This project is no longer maintained by 10up. We are no longer responding to Issues or Pull Requests unless they relate to security concerns. We encourage interested developers to fork this project and make it their own!

Like what you see?

About

ARCHIVED: One-to-one relationships between posts and terms

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages