• Stars
    star
    122
  • Rank 292,031 (Top 6 %)
  • Language
    PHP
  • Created over 10 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Some boilerplate post type code.

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.

More Repositories

1

options-framework-plugin

An Options Panel Framework to help speed theme development.
PHP
838
star
2

options-framework-theme

An Options Panel Framework to help speed theme development.
PHP
757
star
3

customizer-library

Customizer Library
PHP
258
star
4

flutter_todo

Example Flutter to-do app that uses a REST API.
Dart
191
star
5

portfolio-post-type

A WordPress plugin that creates a Portfolio post type.
PHP
154
star
6

laravel-react-bootstrap

Example to-do app (including auth) built with Laravel 8 and React.
PHP
145
star
7

portfolio-press

A WordPress theme for artists and designers to showcase their work.
CSS
62
star
8

better-blockquotes

A plugin for improving the blockquote button in the WordPress editor.
PHP
57
star
9

customizer-library-demo

Demo for the Customizer Library project.
PHP
54
star
10

thematic-options

A theme options framework for WordPress.
PHP
53
star
11

documentation-post-type

Created a WordPress custom post type for product documentation.
PHP
40
star
12

platform

A base theme designed for development workflow.
PHP
37
star
13

event-posts

A small plugin that creates and event post type and meta boxes
PHP
37
star
14

woocommerce-coupon-restrictions

Experiments with coupon restrictions.
PHP
29
star
15

edd-theme-updater

Sample theme updater for EDD.
PHP
25
star
16

angular-experiments

Collection of experiments as I work through learning Angular + the JSON API for WordPress.
PHP
23
star
17

foghorn

Foghorn is a minimalist WordPress theme built off the foundation of Twenty Eleven.
PHP
19
star
18

edd-account-helpers

Example code for building a dashboard are with Easy Digital Downloads.
PHP
16
star
19

visual

Visual is a dark minimalist WordPress theme for displaying photos and images.
CSS
14
star
20

options-framework-theme-demos

Demos for Options Framework.
PHP
13
star
21

customizer-background-control

Registers a new custom customizer control for backgrounds.
PHP
12
star
22

no-slug-portfolio-post-types

Tiny little plugin to remove the slug from portfolio post types.
PHP
11
star
23

history-future

Snappy WordPress Ajax Theme for Byron Reece
PHP
11
star
24

auto-set-featured-image

Auto set a featured image in WordPress.
PHP
11
star
25

light

A lightweight WordPress blog theme
PHP
9
star
26

post-author-optimization-for-woocommerce

Stores the customer_user for WooCommerce orders and subscriptions in the post_author column of posts table.
PHP
9
star
27

woocommerce-customer-source

Learn where your WooCommerce customers are coming from.
PHP
8
star
28

flutter_okta

Proof of concept Flutter + Okta integration.
Dart
8
star
29

edd-free-license-generator

Allows users to bypass checkout page when downloading a specific product. Should be used in conjuction with the EDD Software Licensing Plugin.
PHP
8
star
30

laravel-react-material

Example Material UI to do app that integrates with a Laravel REST API.
JavaScript
6
star
31

post-loaded-avatars

A simple WordPress plugin to post load avatar images.
PHP
6
star
32

gad7

A mobile app built on Flutter to help track anxiety.
Dart
5
star
33

instant-content

WordPress plugin for purchasing Demand Media content.
PHP
3
star
34

salaryinflation

Calculate an inflation adjusted salary.
JavaScript
3
star
35

portfolio-plus

Commercial version of Portfolio Press
PHP
2
star
36

date_picker_input

Example of a date picker input in Flutter.
Dart
2
star
37

twentyfifteen-srcset

Experiments with Twenty Fifteen and Responsive Images
PHP
2
star
38

postlistr-plugin

Trying to learn some backbone.
PHP
1
star
39

wpe-sync

Bash script for syncing in WP Engine environment.
Shell
1
star
40

flutterfort

Gatsby.js site for Flutter blog.
JavaScript
1
star
41

woocommerce-wholesale-role-restriction

This extension prevents customers with a "wholesale" role from using coupons on the site.
PHP
1
star
42

percentchange

Percent Change Calculator
HTML
1
star
43

woocommerce-friendbuy

Plugin allows easy integration between Friendbuy and WooCommerce.
PHP
1
star
44

edd-facebook-analytics

Adds Facebook tracking to your website for conversion metrics and ad re-marketing.
JavaScript
1
star
45

MeasureVW.js

Simple developer tool for measuring elements in vw units.
JavaScript
1
star
46

fallback-languages

Better translation loading in WordPress.
PHP
1
star