Created
July 16, 2016 16:54
-
-
Save salcode/be98a45d42c78ca96229b02f567caa33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The code to register a WordPress Custom Post Type (CPT) `fe_recipe` | |
* with a custom Taxonomy `fe_recipe_tag` | |
* @package fe_recipe | |
*/ | |
add_action( 'init', 'fe_recipe_cpt' ); | |
/** | |
* Register a public CPT and Taxonomy | |
*/ | |
function fe_recipe_cpt() { | |
// Post type should be prefixed, singular, and no more than 20 characters. | |
register_post_type( 'fe_recipe', array( | |
// Label should be plural and L10n ready. | |
'label' => apply_filters( 'fe_accomodatinos_label', __( 'Accommodations', 'fe_recipe' ) ), | |
'public' => true, | |
'has_archive' => true, | |
'rewrite' => array( | |
// Slug should be plural and L10n ready. | |
'slug' => apply_filters( 'fe_accommodations_slug', _x( 'accommodations', 'CPT permalink slug', 'fe_recipe' ) ), | |
'with_front' => false, | |
), | |
/** | |
* 'title', 'editor', 'thumbnail' 'author', 'excerpt','custom-fields', | |
* 'page-attributes' (menu order),'revisions' (will store revisions), | |
* 'trackbacks', 'comments', 'post-formats', | |
*/ | |
'support' => array( 'title', 'editor' ), | |
// Url to icon or choose from built-in https://developer.wordpress.org/resource/dashicons/. | |
'menu_icon' => 'dashicons-feedback', | |
) ); | |
} |
Author
salcode
commented
Jul 16, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment