2017 © Pedro Peláez
 

library posttype

image

tkj/posttype

  • Tuesday, March 18, 2014
  • by tkjaergaard
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Wordpress Posttype

Easy API to create Wordpress posttypes., (*1)

Installation

To install this package you have a couple of options., (*2)

Install through composer

require {
    "tkj/posttype": "1.*"
}

Manual install through git

Clone the git repository into your prefered destination in your theme directory and require the Posttype.php in your functions.php, (*3)

git clone git@github.com:tkjaergaard/Wordpress-Posttype.git

Usage

The API of this package is quite simple. Simply create a new instance of Tkj\Posttype or use the facade Tkj\Posttype::make(), (*4)

<?php

use Tkj\Posttype;

new Posttype($singular);

Posttype::make($singular);

Arguments

Argument Required Type Description
$singluar True String Singular name of the post type
$plural Optional String Plural name of the post type.
$options Optional Array Array of options.
$labels Optional Array Array of labels.

The options and labels array uses the same structure as Wordpress reqister_post_type() function., (*5)

Default options

The default options are pretty basic and shoud fit your needs in most cases., (*6)

{
    'public':               true,
    'publicly_queryable':   true,
    'show_ui':              true,
    'show_in_menu':         true,
    'query_var':            true,
    'capability_type':      'post',
    'has_archive':          true,
    'hierarchical':         false,
    'menu_position':        null,
    'supports':             ['title', 'editor', 'thumbnail', 'excerpt']
}

Default labels

The labes are generated from the singular and/or the plural arguments you use to create the post type. The labels are generated in english., (*7)

License

This package is released under the MIT license., (*8)

Author

Thomas Kjaergaard @t_kjaergaard tkjaergaard.dk, (*9)

The Versions

18/03 2014

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by t_kjaergaard

18/03 2014

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by t_kjaergaard

06/05 2013

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by t_kjaergaard