Skip to content

Instantly share code, notes, and snippets.

@chrisaldrich
Forked from dshanske/kind-register.php
Last active January 20, 2020 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisaldrich/a6e33bf50e7de75024d810743672ee6d to your computer and use it in GitHub Desktop.
Save chrisaldrich/a6e33bf50e7de75024d810743672ee6d to your computer and use it in GitHub Desktop.
Post Kinds Acquisition custom plugin
<?php
/**
* Plugin Name: Register Post Kind - Acquisition
* Plugin URI: https://boffosocko.com
* Description: Register Acquisition Post Kind
* Version: 0.1
* Author: Chris Aldrich and David Shanske
* Author URI: https://boffosocko.com
* Text Domain:
* Domain Path:
*/
function acquisition_register_kind() {
register_post_kind(
'acquisition',
array(
'singular_name' => __( 'Acquisition', 'indieweb-post-kinds' ), // Name for one instance of the kind
'name' => __( 'Acquisitions', 'indieweb-post-kinds' ), // General name for the kind plural
'verb' => __( 'Acquired', 'indieweb-post-kinds' ), // The string for the verb or action (liked this)
'property' => 'acquired-of', // microformats 2 property (acquired-of is experimental)
'format' => 'status', // Post Format that maps to this
'description' => __( 'Purchases, gifts, found things, or objects donated to me', 'indieweb-post-kinds' ),
'description-url' => 'http://indieweb.org/acquisition',
'title' => false, // Should this kind have an explicit title
'show' => true, // Show in Settings
)
);
set_post_kind_visibility( 'follow' ); // Example of how to enable a hidden kind.
}
add_action( 'init', 'acquisition_register_kind' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment