A super simple abstraction to make creating a custom Taxonomies in WordPress a breeze

Overview

Custom Taxonomy Helper

A super simple abstraction to make creating a custom Taxonomies in WordPress a breeze.

Installation

You can either a) install with composer or b) copy the main the file and require it your functions file.

Composer

In your terminal, in the directory where your composer.json is (usually the theme directory):

composer require itsmejgrant/custom-taxonomy-helper

Then, in your function.php file:

use Itsmejgrant\TaxonomyHelper\Taxonomy

That's it, you're ready to go!

Manual installation

Copy the contents of the Taxonomy.php file and put it whereever makes sense in your theme directory.

Require it whereever you will be using it with:

require 'path/to/your/Taxonomy.php';

Usage

To use the helper, assign a new instance to a variable and manipulate as required. The only required arguments are the name of the taxonomy and either a string or array of post types to assign it to.

Examples:

function assigning_to_one_post_type() {
  $regions = new Taxonomy('Regions', 'posts');
}
add_action('init', 'assigning_to_one_post_type');
function assigning_to_multiple_post_types() {
  $regions = new Taxonomy('Regions', ['posts', 'pages']);
}
add_action('init', 'assigning_to_multiple_post_types');
You might also like...
Wordless is a junction between a WordPress plugin and a theme boilerplate that dramatically speeds up and enhances your custom theme creation
Wordless is a junction between a WordPress plugin and a theme boilerplate that dramatically speeds up and enhances your custom theme creation

Wordless is a junction between a WordPress plugin and a theme boilerplate that dramatically speeds up and enhances your custom theme creation. Some of

A custom update API for WordPress plugins and themes

A custom update API for WordPress plugins and themes. Intended to be used in conjunction with my plugin-update-checker library.

WordPress plugin to make it easier to create block patterns.

=== Templets === Contributors: mkaz Tags: block patterns, patterns Requires at least: 5.8 Tested up to: 5.8 Requires PHP: 7.3 Stable tag: 0.2.0 Licens

A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings.
A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings.

Suspend WP A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings. 😎 Demo (coming so

WordPress & TypeScript. Simple starter template for WordPress projects

WordPress & TypeScript. Simple starter template for WordPress projects that want to use TypeScript in combination with @wordpress/scripts

Simple WordPress plugin to learn how to understand WordPress Crons and the Action Scheduler library.

Simple WordPress plugin to learn how to understand WordPress Crons and the Action Scheduler library. Import Jamendo playlists with tracks in WordPress posts.

A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities.

Awesome WordPress A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities. Inspired by bayand

The Pronamic WordPress Basecone plugin allows you to connect your WordPress installation to Basecone.

Pronamic WordPress Basecone The Pronamic WordPress Basecone plugin allows you to connect your WordPress installation to Basecone. Table of contents Au

Twenty Twenty-Two, the default WordPress theme that will launch with WordPress 5.9.
Twenty Twenty-Two, the default WordPress theme that will launch with WordPress 5.9.

Twenty Twenty-Two Welcome to the development repository for the default theme that will launch with WordPress 5.9. About Twenty Twenty-Two is designed

Releases(1.0.1)
Owner
Joe Grant
Front end developer
Joe Grant
A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.

WP Bootstrap Navwalker This code in the main repo branch is undergoing a big shakeup to bring it in line with recent standards and to merge and test t

WP Bootstrap 3.3k Jan 5, 2023
A PHP Class for creating Wordpress Custom Post Types easily

N.B I've released an updated version of the project to a new repository, PostTypes. WP Custom Post Type Class v1.4 A single class to help you build mo

Joe Grainger 412 Nov 25, 2022
A WordPress package for updating custom plugins and themes based on an API response from a custom update server.

WordPress Update Handler A WordPress package for updating custom plugins and themes based on an JSON REST API response from a custom update server. Ch

WP Forge 7 Oct 5, 2022
Wordpress advance plugin with multi purposes features like live chat, custom post type, custom forms, word count etc

What is this? This is wordpress plugin which is created for the multi purpose uses. How to use? Simply install the plugin. Go to the plugin settigs pa

Amir Liaqat 2 Jun 23, 2022
Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple

Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple

Joan 9 Oct 10, 2022
Querycase provides a convenient, fluent interface for creating and running database queries in WordPress.

Querycase database for WordPress Dependency-free library to create SQL Queries in WordPress. Explore the documentation → ℹī¸ About Querycase Querycase

Alessandro Tesoro 7 Oct 17, 2021
Scaffold plugin for creating and managing Blocks, Block Patterns, Block Styles and Block Editor Sidebars in the WordPress Block Editor (aka Gutenberg).

WordPress Block Editor Scaffold This project is a template repo for developing WordPress Blocks, Block Patterns, Block Styles and Block Editor Sidebar

Rareview 6 Aug 2, 2022
Base classes for creating WordPress shortcodes.

WDS Shortcodes Contributors: WebDevStudios, jtsternberg, JayWood Donate link: http://webdevstudios.com Tags: shortcode button, shortcodes, cmb2, utili

WebDevStudios 26 Jun 19, 2020
Custom WordPress theme for DotOrg

wd_s Debt Collective Theme Table of Contents Introduction Getting Started Prerequisites Quick Start Advanced Setup Development Contributing and Suppor

The Debt Collective 1 Oct 31, 2022
Word Count (Custom WordPress Plugin)

word-count (Custom WordPress Plugin) Followed a tutorial to create a plugin that adds word count infos to the frontend (Posts only). I then modified t

null 1 Feb 4, 2022