All Projects → soberwp → Models

soberwp / Models

Licence: mit
WordPress plugin to create custom post types and taxonomies using JSON, YAML or PHP files

Projects that are alternatives of or similar to Models

Raccoon Plugin
With Raccoon, use a JSON or YAML file to manage WordPress theme features
Stars: ✭ 18 (-89.22%)
Mutual labels:  wordpress, json, yaml, wordpress-plugin
Themeforest Wp Theme Approval Checklist
A comprehensive list of rejection messages which you should avoid to get your WordPress theme approved quickly in Themeforest
Stars: ✭ 150 (-10.18%)
Mutual labels:  wordpress, wordpress-plugin
Configurate
A simple configuration library for Java applications providing a node structure, a variety of formats, and tools for transformation
Stars: ✭ 148 (-11.38%)
Mutual labels:  json, yaml
Wp Document Revisions
A document management and version control plugin that allows teams of any size to collaboratively edit files and manage their workflow.
Stars: ✭ 152 (-8.98%)
Mutual labels:  wordpress, wordpress-plugin
Simple Settings
A simple way to manage your project settings.
Stars: ✭ 165 (-1.2%)
Mutual labels:  json, yaml
Live Composer Page Builder
Free page builder plugin for WordPress http://livecomposerplugin.com
Stars: ✭ 143 (-14.37%)
Mutual labels:  wordpress, wordpress-plugin
Stackable
Page Builder Blocks for WordPress. An Amazing Block Library for the new WordPress Block Editor (Gutenberg).
Stars: ✭ 151 (-9.58%)
Mutual labels:  wordpress, wordpress-plugin
Fig
A minimalist Go configuration library
Stars: ✭ 142 (-14.97%)
Mutual labels:  json, yaml
Feedparser
feedparser gem - (universal) web feed parser and normalizer (XML w/ Atom or RSS, JSON Feed, HTML w/ Microformats e.g. h-entry/h-feed or Feed.HTML, Feed.TXT w/ YAML, JSON or INI & Markdown, etc.)
Stars: ✭ 156 (-6.59%)
Mutual labels:  json, yaml
Uxdm
🔀 UXDM helps developers migrate data from one system or format to another.
Stars: ✭ 159 (-4.79%)
Mutual labels:  wordpress, json
Gitium
Keep all your WordPress code on git with a simple plugin and a repo
Stars: ✭ 159 (-4.79%)
Mutual labels:  wordpress, wordpress-plugin
Bootstrap Blocks Wordpress Plugin
Bootstrap Gutenberg Blocks for WordPress
Stars: ✭ 143 (-14.37%)
Mutual labels:  wordpress, wordpress-plugin
Gdpr
This plugin is meant to assist a Controller, Data Processor, and Data Protection Officer (DPO) with efforts to meet the obligations and rights enacted under the GDPR.
Stars: ✭ 141 (-15.57%)
Mutual labels:  wordpress, wordpress-plugin
Codestar Framework
A Simple and Lightweight WordPress Option Framework for Themes and Plugins
Stars: ✭ 147 (-11.98%)
Mutual labels:  wordpress, wordpress-plugin
Wp Toolbelt
A lightweight, multi-purpose, WordPress plugin with a focus on privacy and speed
Stars: ✭ 141 (-15.57%)
Mutual labels:  wordpress, wordpress-plugin
Gelatin
Transform text files to XML, JSON, or YAML
Stars: ✭ 150 (-10.18%)
Mutual labels:  json, yaml
Wp Graphql Gutenberg
Query gutenberg blocks with wp-graphql
Stars: ✭ 158 (-5.39%)
Mutual labels:  wordpress, wordpress-plugin
Wprecon
WPrecon (WordPress Recon), is a vulnerability recognition tool in CMS Wordpress, developed in Go and with scripts in Lua.
Stars: ✭ 135 (-19.16%)
Mutual labels:  wordpress, wordpress-plugin
Cfgdiff
diff(1) all your configs
Stars: ✭ 138 (-17.37%)
Mutual labels:  json, yaml
Dhallj
Dhall for Java
Stars: ✭ 154 (-7.78%)
Mutual labels:  json, yaml

Models

Models is a WordPress plugin allowing you to create custom post types and taxonomies using JSON, YAML or PHP files.

You can now set post types and taxonomies using Intervention 2.x.x.

Installation

Composer:

Recommended methods:

Roots Bedrock

$ composer require soberwp/models:1.1.0

Models is a mu-plugin so it doesn't have to be activated.

Roots Sage

$ composer require soberwp/models:1.1.0-p

Manual:

  • Download the zip file
  • Unzip to your sites plugin folder
  • Activate via WordPress

Requirements:

Setup

By default, create folder models/ within the active theme directory.

If you are a Roots Sage the default folder is app/models/

Alternatively, you can define a custom path using the filter below within your themes functions.php file:

add_filter('sober/models/path', function () {
    return get_stylesheet_directory() . '/your-custom-folder';
});

That's it, now go ahead and add model-name.json files, in the folder or subfolders to begin creating your models. Use Unravel to automatically move the config files outside of your theme path for better separation of concerns.

Usage

The data structure follows a similar data structure to WordPress taxonomies and post types arrays, so if an config option is missing from the examples below, follow the developer's reference and place it within "config": {}

If values are not specified, defaults are the same as WordPress defaults.

Additionally, if the Extended CPTs library is available, Models will use it when registering your post types and taxonomies instead allowing extended functionality within your Models.

Extracted examples presented below are in JSON format.

Post Types

Create a custom post type.

Required:

{
  "type": "post-type",
  "name": "book"
}

Basic:

{
  "type": "cpt",
  "name": "book",
  "supports": [
    "title", "editor", "thumbnail"
  ],
  "labels": {
    "has_one": "Book",
    "has_many": "Books",
    "text_domain": "sage"
  }
}

In the above example, "labels": {} are redundant because "Book" and "Books" would have been generated from "name".

Multiple:

[
  {
    "type": "cpt",
    "name": "book",
    "supports": [
      "title", "editor", "thumbnail"
    ]
  },
  {
    "type": "cpt",
    "name": "album",
    "supports": [
      "title", "editor", "comments"
    ]
  }
]

All Fields:

Post Type Tips:

  • "active": false stops the post type from being created. Default is set to true.
  • "type": "post-type" also accepts a shorthand "type": "cpt";

Taxonomies

Create a custom taxonomy.

Required:

{
  "type": "taxonomy",
  "name": "genre"
}

Basic:

{
  "type": "tax",
  "name": "genre",
  "links": [
    "post", "book"
  ],
  "labels": {
    "has_one": "Book Genre",
    "has_many": "Book Genres",
    "text_domain": "sage"
  }
}

"links": (string|array) assigns the taxonomy to post types. Defaults to "links": "post"

Multiple:

[
  {
    "type": "category",
    "name": "genre",
    "links": "book"
  },
  {
    "type": "tag",
    "name": "author",
    "links": "book"
  }
]

"type": "category" and "type": "tag" shorthands are explained below under Tips.

All Fields:

Taxonomy Tips:

  • "active": false stops the taxonomy from being created. Default is set to true.
  • "type": "taxonomy" also accepts shorthands;
    • "type": "tax"
    • "type": "category" or "type": "cat" creates a category taxonomy.
    • "type": "tag" creates a tag taxonomy.

Support

Updates

Composer:

  • Change the composer.json version to ^1.0.4**
  • Check CHANGELOG.md for any breaking changes before updating.
$ composer update

WordPress:

Includes support for github-updater to keep track on updates through the WordPress backend.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].