Code Monkey home page Code Monkey logo

registry's Introduction

wp-kit/registry

This is a wp-kit component that handles PostType and Taxonomy registration.

This component was built to run within an Illuminate\Container\Container so is perfect for frameworks such as Themosis, Assely and wp-kit/theme.

wp-kit/registry is fully comptaible with Themosis and if you are using Themosis you'll notice it already has a PostTypeBuilder and a TaxonomyBuilder but wp-kit/registry just simplifies the process by providing an OOP approach to registering PostTypes and Taxonomies.

Installation

If you're using Themosis, install via Composer in the Themosis route folder, otherwise install in your Composer driven theme folder:

composer require "wp-kit/registry"

Setup

Add Service Provider

Just register the service provider and facade in the providers config and theme config:

//inside theme/resources/config/providers.config.php

return [
    //
    WPKit\Registry\RegistryServiceProvider::class,
    //
];

Add PRS4 Class Reference (Themosis Only)

Just add the following line to resources/config/loading.config.php in the Themosis theme folder:

'Theme\\Taxonomies\\' => themosis_path('theme.resources').'taxonomies',
'Theme\\PostTypes\\' => themosis_path('theme.resources').'postTypes',

Add Config & View File

The recommended method of installing config files for wp-kit components is via wp kit vendor:publish command.

First, install WP CLI, and then install this component, wp kit vendor:publish will automatically be installed with wp-kit/utils, once installed you can run:

wp kit vendor:publish

For more information, please visit wp-kit/utils.

Alternatively, you can place the config file(s), post type file(s) and taxonomy file(s) in your theme/resources/config, theme/resources/postTypes and theme/resources/taxonomies directories manually.

Usage

Adding Classes

wp-kit\registry comes with two classes that can extended, WPKit\Registry\PostType and WPKit\Registry\Taxonomy.

Any custom PostTypes and Taxonomies should be added inside resources/shortcodes within the namespace Theme\PostType or Theme\Taxonomy.

Here is an example PostType class.

Here is an example Taxonomy class.

Get Involved

To learn more about how to use wp-kit check out the docs:

View the Docs

Any help is appreciated. The project is open-source and we encourage you to participate. You can contribute to the project in multiple ways by:

  • Reporting a bug issue
  • Suggesting features
  • Sending a pull request with code fix or feature
  • Following the project on GitHub
  • Sharing the project around your community

For details about contributing to the framework, please check the contribution guide.

Requirements

Wordpress 4+

PHP 5.6+

License

wp-kit/registry is open-sourced software licensed under the MIT License.

registry's People

Contributors

terence1990 avatar

Stargazers

Alessandro Tesoro avatar Chauncey McAskill avatar

Watchers

James Cloos avatar  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.