Skip to content
A WordPress plugin to register custom taxonomies accessible on your entire multisite network.
PHP JavaScript Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Fixing circleci config file (DEV-310) Mar 16, 2018
assets
inc Make the term cloud terms filterable Jun 11, 2019
.editorconfig Adding plugin skeleton May 2, 2017
.gitignore
LICENSE Initial commit May 1, 2017
README.md
composer.json Whitelisting Code Jun 10, 2019
docker-compose.yml Adding local dev environment May 2, 2017
index.php
install.sh
multisite-taxonomies.php
phpcs.xml Ignore Prepared SQL Feb 27, 2019
readme.txt

README.md

Multisite Taxonomies

A WordPress plugin

Multisite Taxonomies brings the ability to register custom taxonomies, accessible on an entire multisite network, to WordPress.

Master branch: CircleCI

Coding standards

We follow WordPress Coding Standards and enforce them using PHP Code Sniffer.

To test localy simply run:

  • $ composer install (if you haven't already)
  • $ ./vendor/bin/phpcs ./

Dependencies:

How to get started?

  • Start by copying the plugin to your website's WordPress plugin directory.
  • Activate the plugin.
  • A Multisite Taxonomy menu will appear in the admin but it will be blank.
  • Add taxonomies to the website by using register_multisite_taxonomy called on the init hook. We would recommend doing this in a separate plugin of your creation.
  • Multisite tags can then be added to posts through the post edit screen on any site on the network.

Register Taxonomy Example:

add_action( 'init', 'register_multisite_taxonomies', 0 );

/**
 * Load in all taxonomies.
 *
 * @return void
 */
function register_multisite_taxonomies() {
    /**
     * Load taxonomy for Tags
     */
    $labels     = array(
        'name'                       => __( 'Tags', 'hsph-plugin-tagging' ),
        'singular_name'              => __( 'Tag', 'hsph-plugin-tagging' ),
        'menu_name'                  => __( 'Tags', 'hsph-plugin-tagging' ),
        'all_items'                  => __( 'All Tags', 'hsph-plugin-tagging' ),
        'new_item_name'              => __( 'New Tag Name', 'hsph-plugin-tagging' ),
        'add_new_item'               => __( 'Add New Tag', 'hsph-plugin-tagging' ),
        'edit_item'                  => __( 'Edit Tag', 'hsph-plugin-tagging' ),
        'update_item'                => __( 'Update Tag', 'hsph-plugin-tagging' ),
        'view_item'                  => __( 'View Tag', 'hsph-plugin-tagging' ),
        'separate_items_with_commas' => __( 'Separate tags with commas', 'hsph-plugin-tagging' ),
        'add_or_remove_items'        => __( 'Add or remove tags', 'hsph-plugin-tagging' ),
        'choose_from_most_used'      => __( 'Choose from the most used tags', 'hsph-plugin-tagging' ),
        'popular_items'              => __( 'Popular Tags', 'hsph-plugin-tagging' ),
        'search_items'               => __( 'Search Tags', 'hsph-plugin-tagging' ),
        'not_found'                  => __( 'No Tags Found', 'hsph-plugin-tagging' ),
        'no_terms'                   => __( 'No tags for this category', 'hsph-plugin-tagging' ),
        'most_used'                  => __( 'Most Used', 'hsph-plugin-tagging' ),
        'items_list'                 => __( 'Tags list', 'hsph-plugin-tagging' ),
        'items_list_navigation'      => __( 'Tags list navigation', 'hsph-plugin-tagging' ),
    );

    $args       = array(
        'labels'       => $labels,
        'hierarchical' => false,
    );
    
    $post_types = apply_filters( 'multisite_taxonomy_tags_post_types', array( 'post' ) );
    register_multisite_taxonomy( 'tag', $post_types, $args );
}
You can’t perform that action at this time.