Coder Social home page Coder Social logo

team-post-type's Introduction

Team Post Type

This is meant to be used a custom post type boilerplate plugin- though it does work fine out of the box as a team post type.

Description

This plugin includes a couple common features that are used with custom post types:

  • Registers a post type
  • Registers a custom taxonomy
  • Registers a few metaboxes (Title, Twitter, Facebook, LinkedIn)
  • Adds the featured image to the admin column display
  • Adds the post count to the admin dashboard

Customization

There are a couple filters for the post type and taxonomy arguments in this plugin, but the code is actually meant to be modified directly.

If you want to change this post type from "team" to something different ("products","resources",etc.) you'll want to update a couple file and class names throughout the plugin- but the main modifications will be in the "class-post-type-registrations.php" file. This is where the post type and taxonomy are registered.

For information on all the available arguments, read the codex for register_post_type.

For example, if you were switching the post type from "team" to "products", you would want to alter this code.

Registration for "Team"

$labels = array(
	'name'               => __( 'Team', 'team-post-type' ),
	'singular_name'      => __( 'Team Member', 'team-post-type' ),
	'add_new'            => __( 'Add Profile', 'team-post-type' ),
	'add_new_item'       => __( 'Add Profile', 'team-post-type' ),
	'edit_item'          => __( 'Edit Profile', 'team-post-type' ),
	'new_item'           => __( 'New Team Member', 'team-post-type' ),
	'view_item'          => __( 'View Profile', 'team-post-type' ),
	'search_items'       => __( 'Search Team', 'team-post-type' ),
	'not_found'          => __( 'No profiles found', 'team-post-type' ),
	'not_found_in_trash' => __( 'No profiles in the trash', 'team-post-type' ),
);

$supports = array(
	'title',
	'editor',
	'thumbnail',
	'custom-fields',
	'revisions',
);

$args = array(
	'labels'          => $labels,
	'supports'        => $supports,
	'public'          => true,
	'capability_type' => 'post',
	'rewrite'         => array( 'slug' => 'team', ), // Permalinks format
	'menu_position'   => 30,
	'menu_icon'       => 'dashicons-id',
);

Registration for "Product"

$labels = array(
	'name'               => __( 'Products', 'team-post-type' ),
	'singular_name'      => __( 'Product', 'team-post-type' ),
	'add_new'            => __( 'Add Product', 'team-post-type' ),
	'add_new_item'       => __( 'Add Product', 'team-post-type' ),
	'edit_item'          => __( 'Edit Product', 'team-post-type' ),
	'new_item'           => __( 'New Product', 'team-post-type' ),
	'view_item'          => __( 'View Product', 'team-post-type' ),
	'search_items'       => __( 'Search Products', 'team-post-type' ),
	'not_found'          => __( 'No products found', 'team-post-type' ),
	'not_found_in_trash' => __( 'No products in the trash', 'team-post-type' ),
);

$supports = array(
	'title',
	'editor',
	'thumbnail',
	'custom-fields',
	'revisions',
);

$args = array(
	'labels'          => $labels,
	'supports'        => $supports,
	'public'          => true,
	'capability_type' => 'post',
	'rewrite'         => array( 'slug' => 'product', ), // Permalinks format
	'menu_position'   => 30,
	'menu_icon'       => 'dashicons-cart',
);

To find different icons to use ("menu_icon" parameter) see the dashicons page.

Requirements

  • WordPress 3.8 or higher

Frequently Asked Questions

Why did you make this?

To save myself time when custom post types are required for client projects.

Is this plugin on the WordPress repo?

No. It's meant to be more of a white-label plugin to use for your own client projects.

Credits

Built by Devin Price. The "Dashboard Glancer" class and much re-used code from the Portfolio Post Type plugin by Gary Jones.

team-post-type's People

Contributors

devinsays 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.