{"id":21611526,"url":"https://github.com/underpin-wp/taxonomy-loader","last_synced_at":"2026-05-20T06:02:40.022Z","repository":{"id":57075298,"uuid":"364075009","full_name":"Underpin-WP/taxonomy-loader","owner":"Underpin-WP","description":"Underpin loader for custom WordPress taxonomies","archived":false,"fork":false,"pushed_at":"2021-11-24T21:42:36.000Z","size":14,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T01:01:52.607Z","etag":null,"topics":["taxonomy","underpin","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Underpin-WP.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-03T22:16:01.000Z","updated_at":"2021-11-24T21:42:39.000Z","dependencies_parsed_at":"2022-08-24T14:55:42.016Z","dependency_job_id":null,"html_url":"https://github.com/Underpin-WP/taxonomy-loader","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Underpin-WP%2Ftaxonomy-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Underpin-WP%2Ftaxonomy-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Underpin-WP%2Ftaxonomy-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Underpin-WP%2Ftaxonomy-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Underpin-WP","download_url":"https://codeload.github.com/Underpin-WP/taxonomy-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257304,"owners_count":20424131,"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":["taxonomy","underpin","wordpress"],"created_at":"2024-11-24T21:13:00.463Z","updated_at":"2026-05-20T06:02:34.983Z","avatar_url":"https://github.com/Underpin-WP.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Underpin Taxonomy Loader\n\nLoader That assists with registering taxonomy taxonomies to a WordPress website.\n\n## Installation\n\n### Using Composer\n\n`composer require underpin/taxonomy-loader`\n\n### Manually\n\nThis plugin uses a built-in autoloader, so as long as it is required _before_\nUnderpin, it should work as-expected.\n\n`require_once(__DIR__ . '/underpin-taxonomies/taxonomies.php');`\n\n## Setup\n\n1. Install Underpin. See [Underpin Docs](https://www.github.com/underpin-wp/underpin)\n1. Register new taxonomies menus as-needed.\n\n## Example\n\nA very basic example could look something like this.\n\n```php\n// Register taxonomy\nunderpin()-\u003etaxonomies()-\u003eadd( 'taxonomy', [\n\t'post_type'   =\u003e 'post',                        // Defaults to post.\n\t'id'          =\u003e 'ingredients',                 // Required. See register_taxonomy\n\t'description' =\u003e 'Ingredients for this recipe', // Human-readable description.\n\t'name'        =\u003e 'Ingredients',                 // Human-readable name. Usually plural. Will set \"label\" argument if name is unset in args.\n\t'args'        =\u003e [                              // Default atts. See register_taxonomy\n\t\t'public' =\u003e true,\n\t],\n] );\n```\n\nAlternatively, you can extend `Taxonomy` and reference the extended class directly, like so:\n\n```php\nunderpin()-\u003etaxonomies()-\u003eadd('taxonomy-key','Namespace\\To\\Class');\n```\n\n## Querying\n\nA Taxonomy instance includes a method, called `query`, which serves as a wrapper for `new WP_Term_Query`.\n\nThis encapsulates queries for this taxonomy in a method, and gives you a place to override exactly _how_ this taxonomy\nis queried, should you decide to extend the class.\n\n```php\nunderpin()-\u003etaxonomies()-\u003eget( 'taxonomy' )-\u003equery();\n```\n\n## Editing Terms\n\nLike querying, Taxonomy instances includes a method called `save` which serves as a wrapper for `wp_insert_term`\nand `wp_update_term`. It also includes notice-logging so you can track what happens on a request.\n\nThis encapsulates save actions for this taxonomy in a set of methods, and gives you a place to override exactly _how_\nthis taxonomy is saved, should you decide to extend the class.\n\n```php\nunderpin()-\u003etaxonomies()-\u003eget( 'taxonomy' )-\u003esave( [/* see wp_insert_post */] );\n```\n\n## Deleting Terms\n\nThis works in the same way as `save` and `query`. It includes logging, and provides a way to encapsulate the action.\n\n```php\nunderpin()-\u003etaxonomies()-\u003eget( 'taxonomy' )-\u003edelete( $term );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funderpin-wp%2Ftaxonomy-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funderpin-wp%2Ftaxonomy-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funderpin-wp%2Ftaxonomy-loader/lists"}