GithubHelp home page GithubHelp logo

theperfectwill / extended-taxos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johnbillion/extended-taxos

0.0 1.0 0.0 80 KB

A library which provides extended functionality to WordPress custom taxonomies, allowing you to quickly build custom taxonomies without having to write the same code again and again.

License: GNU General Public License v2.0

PHP 100.00%

extended-taxos's Introduction

Stable Release License

Extended Taxonomies

Extended Taxonomies is a library which provides extended functionality to WordPress custom taxonomies, allowing developers to quickly build custom taxonomies without having to write the same code again and again.

This library requires its sister library Extended CPTs to be installed too.

Improved defaults

  • Automatically generated labels and term updated messages
  • Public taxonomy with admin UI enabled

Extended admin features

  • Ridiculously easy custom columns on the term listing screen:
    • Columns available for term meta and callback functions
    • User capability restrictions
  • Several custom meta boxes to choose from for the taxonomy's term input on the post editing screen:
    • 'simple' for a meta box with a simplified list of checkboxes
    • 'radio' for a meta box with radio inputs
    • 'dropdown' for a meta box with a dropdown menu
    • Or a callback function
  • Add the taxonomy to the 'At a Glance' section on the dashboard

Extended front-end features

Minimum Requirements

PHP: 5.4
WordPress: 4.4
Extended CPTs: 3.0

Usage

Extended Taxonomies is a developer library, not a plugin, which means you need to include it somewhere in your own plugin or theme:

require_once 'extended-taxos/extended-taxos.php';

Need a simple taxonomy with no frills? You can register a taxonomy with two parameters:

register_extended_taxonomy( 'location', 'post' );

Try it. You'll have a hierarchical public taxonomy with an admin UI, and all the labels and term updated messages will be automatically generated. Or for a bit more functionality:

register_extended_taxonomy( 'story', 'post', array(

	# Use radio buttons in the meta box for this taxonomy on the post editing screen:
	'meta_box' => 'radio',

	# Show this taxonomy in the 'At a Glance' dashboard widget:
	'dashboard_glance' => true,

	# Add a custom column to the admin screen:
	'admin_cols' => array(
		'updated' => array(
			'title'       => 'Updated',
			'meta_key'    => 'updated_date',
			'date_format' => 'd/m/Y'
		),
	),

), array(

	# Override the base names used for labels:
	'singular' => 'Story',
	'plural'   => 'Stories',
	'slug'     => 'tales'

) );

Bam, we have a 'Stories' taxonomy attached to the Post post type, with correctly generated labels and term updated messages, radio buttons in place of the standard meta box for this taxonomy on the post editing screen, a custom column in the admin area (you need to handle the term meta population yourself), and a count of the terms in this taxonomy in the 'At a Glance' dashboard widget.

The register_extended_taxonomy() function is ultimately a wrapper for register_taxonomy(), so any of the latter's parameters can be used.

License: GPLv2 or later

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

extended-taxos's People

Contributors

johnbillion avatar lucatume avatar simonwheatley avatar spacedmonkey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.