Giter VIP home page Giter VIP logo

json-api-cpt's Introduction

=== JSON API CPT ===

Donate link:

Tags: json api, RESTful cpt, cpt json

Contributors: Alberto Cocchiara

Stable tag: 1.0

Requires at least: 3.0.1

Tested up to: 4.4.2

License: GPLv2 or later

License URI: http://www.gnu.org/licenses/gpl-2.0.html

Extends the JSON API for RESTful CPT get

==Description==

This plugin is an Extension of JSON API plugin and extend the functionality to allow any user to get, edit, add, update and delete any kind of post type.

Features include:

  • CPT get by post type name
  • CPT get by post type name and status

The plugin was created to make available cpt Easy with any mobile or web app external to the loved WordPress CMS.

Hope this will help some.

For details, please check this: http://www.altertech.it/solutions/json-api-cpt/

==Installation==

First you have to install the JSON API Plugin (http://wordpress.org/extend/plugins/json-api/installation/).

In order to use JSON API - CPT you need to add a Custom Post type to your theme with or without plugin. Below there is a snippet for build product CPT:

// Register Custom Post Type function products_post_type() {

$labels = array(
	'name'                  => _x( 'Products', 'Post Type General Name', 'text_domain' ),
	'singular_name'         => _x( 'Product', 'Post Type Singular Name', 'text_domain' ),
	'menu_name'             => __( 'Product', 'text_domain' ),
	'name_admin_bar'        => __( 'Post Type', 'text_domain' ),
	'archives'              => __( 'Item Archives', 'text_domain' ),
	'parent_item_colon'     => __( 'Parent Product:', 'text_domain' ),
	'all_items'             => __( 'All Products', 'text_domain' ),
	'add_new_item'          => __( 'Add New Product', 'text_domain' ),
	'add_new'               => __( 'New Product', 'text_domain' ),
	'new_item'              => __( 'New Item', 'text_domain' ),
	'edit_item'             => __( 'Edit Product', 'text_domain' ),
	'update_item'           => __( 'Update Product', 'text_domain' ),
	'view_item'             => __( 'View Product', 'text_domain' ),
	'search_items'          => __( 'Search products', 'text_domain' ),
	'not_found'             => __( 'No products found', 'text_domain' ),
	'not_found_in_trash'    => __( 'No products found in Trash', 'text_domain' ),
	'featured_image'        => __( 'Featured Image', 'text_domain' ),
	'set_featured_image'    => __( 'Set featured image', 'text_domain' ),
	'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),
	'use_featured_image'    => __( 'Use as featured image', 'text_domain' ),
	'insert_into_item'      => __( 'Insert into item', 'text_domain' ),
	'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),
	'items_list'            => __( 'Items list', 'text_domain' ),
	'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),
	'filter_items_list'     => __( 'Filter items list', 'text_domain' ),
);
$args = array(
	'label'                 => __( 'Product', 'text_domain' ),
	'description'           => __( 'Product information pages', 'text_domain' ),
	'labels'                => $labels,
	'supports'              => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'custom-fields', ),
	'taxonomies'            => array( 'category', 'post_tag' ),
	'hierarchical'          => false,
	'public'                => true,
	'show_ui'               => true,
	'show_in_menu'          => true,
	'menu_position'         => 5,
	'show_in_admin_bar'     => true,
	'show_in_nav_menus'     => true,
	'can_export'            => true,
	'has_archive'           => true,		
	'exclude_from_search'   => false,
	'publicly_queryable'    => true,
	'capability_type'       => 'page',
);
register_post_type( 'product', $args );

} add_action( 'init', 'products_post_type', 0 );

=================================================

To install JSON API cpt just follow these steps:

  • Upload the folder "json-api-cpt" to your WordPress plugin folder (/wp-content/plugins)
  • Activate the plugin through the 'Plugins' menu in WordPress or by using the link provided by the plugin installer
  • Activate the controller through the JSON API menu found in the WordPress admin center (Settings -> JSON API)

==Screenshots==

==Changelog==

= 1.0 =

  • Initial release.

json-api-cpt's People

Contributors

bigbabert avatar

Stargazers

Rihards Mantejs avatar

Watchers

James Cloos avatar  avatar

Forkers

mizunhi

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.