2017 © Pedro Peláez
 

library raskoh

Raskoh - easy wordpress CPT and Taxonomy registration

image

azi/raskoh

Raskoh - easy wordpress CPT and Taxonomy registration

  • Thursday, September 21, 2017
  • by azibaloch
  • Repository
  • 4 Watchers
  • 11 Stars
  • 79 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Raskoh - WP PostType and Taxonomies

Registring custom post types and taxonomies in wordpress is not a headache anymore. Raskoh will make your life simpler., (*1)

Usage in theme functions.php, (*2)

Install

You can insall Raskoh as a wordpress plugin by downloading the package and pulling it in wp-content/plugins folder or using composer., (*3)

Paste this in composer.json file, (*4)

{
   "require" : {
        "azi/raskoh" : "1.*"
   }
}

or just run this command in your project. $ composer require azi/raskoh, (*5)

include composers autoloader in your theme's functions.php, (*6)

require_once "vendor/autoloader.php";

Usage

Register a Post Type

to register a post type, (*7)

$music = new Raskoh\PostType("Music");
$music->register();
Add a Taxonomy

register a taxonomy along with post type, (*8)

$music = Raskoh\PostType::getInstance("Music");
$music->taxonomy('Singer')->register();
Restrict Posts by Term

if you want to add Terms dropdown on WordPress admin interface to restrict posts by terms. just pass a second boolean to php PostType::taxonomy($name, $filters = false) method., (*9)

$music = Raskoh\PostType::getInstance("Music");
$music->taxonomy('Singer', true)->register();
Register Multiple Taxonomies
$music = Raskoh\PostType::getInstance("Music");
$music->taxonomy(['singer','genre'])->register();
Set Icons

you can also set icons to your post type, (*10)

$music = Raskoh\PostType::getInstance("Music");
$music->taxonomy('Singer')->setIcon('dashicons-format-audioy')->register();

you can pass all other arguments listed at Codex for wp_register_post_type() like this, (*11)

$CPT = Raskoh\PostType::getInstance();
$CPT->set{ArgumentName}

The Versions

21/09 2017

dev-master

9999999-dev

Raskoh - easy wordpress CPT and Taxonomy registration

  Sources   Download

MIT

by Azi Baloch

21/09 2017

1.4.1

1.4.1.0

Raskoh - easy wordpress CPT and Taxonomy registration

  Sources   Download

MIT

by Azi Baloch

20/09 2017

1.4

1.4.0.0

Raskoh - easy wordpress CPT and Taxonomy registration

  Sources   Download

MIT

by Azi Baloch

21/02 2017

v1.3.1

1.3.1.0

Raskoh - easy wordpress CPT and Taxonomy registration

  Sources   Download

MIT

by Azi Baloch

13/10 2016

1.3

1.3.0.0

Raskoh - easy wordpress CPT and Taxonomy registration

  Sources   Download

MIT

by Azi Baloch

02/03 2016

1.2

1.2.0.0

Raskoh - easy wordpress CPT and Taxonomy registration

  Sources   Download

MIT

by Azi Baloch

25/06 2015

1.1

1.1.0.0

Raskoh - easy wordpress CPT and Taxonomy registration

  Sources   Download

MIT

by Azi Baloch

04/06 2015

1.0

1.0.0.0

Raskoh - easy wordpress CPT and Taxonomy registration

  Sources   Download

MIT

by Azi Baloch

19/05 2015

v0.1

0.1.0.0

Raskoh - easy wordpress CPT and Taxonomy registration

  Sources   Download

MIT

by Azi Baloch