My code is as follows (I'm working off this tuts+ tutorial):
<?php
/**
* Plugin Name: Sermon Manager Plus
* Plugin URI: #
* Version: 0.1
* Author: Dave Mackey
* Author URI: http://www.davemackey.net/
* Description: A robust system for sermon management.
* License: GPL2
*/
?>
<?php
class SermonManagerPlus {
/**
* Constructor: Called when plugin is initialized.
*/
function __construct() {
add_action( 'init', array( $this, 'register_custom_post_type' ) );
add_action( 'add_meta_boxes', array( $this, 'register_meta_boxes' ) );
}
/**
* Registers a Custom Post Type called series
*/
function register_custom_post_type() {
register_post_type( 'contact', array(
'labels' => array(
'name' => _x( 'Series', 'post type general name', 'sermon-manager-plus' ), // Plural name of CPT
'singular_name' => _x( 'Series', 'post type singular name', 'sermon-manager-plus' ), // Singular name of CPT
'menu_name' => _x( 'Sermons', 'admin menu', 'sermon-manager-plus' ), // Name that appears on the admin menu.
'name_admin_bar' => _x( 'Series', 'sermon-manager-plus'), // Name that appears on top fixed admin menu under new.
'add_new' => _x( 'Add New', 'series', 'sermon-manager-plus'), // Add in admin menu under menu_name.
'add_new_item' => __( 'Add New Series', 'sermon-manager-plus'),
'new_item' => __( 'New Series', 'sermon-manager-plus'),
'edit_item' => __( 'Edit Series', 'sermon-manager-plus'),
'view_item' => __( 'View Series', 'sermon-manager-plus'),
'all_items' => __( 'All Series', 'sermon-manager-plus'),
'search_items' => __( 'Search Series', 'sermon-manager-plus'),
'parent_item_colon' => __( 'Parent Series:', 'sermon-manager-plus'), // Only used with hierarchical CPT.
'not_found' => __( 'No Series Found.', 'sermon-manager-plus'),
'not_found_in_trash' => __('No Series Found in Trash.', 'sermon-manager-plus'),
),
// Frontend
'has_archive' => false, // Specific archive template?
'public' => false, // Can be seen by public?
'public_queryable' => false, // Queryable by public?
// Admin
'capability_type' => 'post', // Use permissions as those used for post.
'menu_icon' => 'dashicons-info', // See developer.wordpress.org/resource/dashicons/
'menu_position' => 10, // Appears below this menu item at the given value: 5 (posts), 10 (media), 15 (links), 20 (pages), 25 (comments)
// 60 (first separator), 65 (plugins), 70 (users), 75 (tools), 80 (settings), 100 (second separator)
'query_var' => true, // Query variable is set to post type.
'show_in_menu' => true, // can be false (don't show), true (show top-level), or a string like 'tools.php' or 'edit.php?post_type="page"', e.g. if you want
// to nest this CPT under another CPT, for example Sermons nested under Series.
'show_ui' => true, // Generates a default UI for managing post type in admin.
'supports' => array( // Options: title, editor, author, thumbnail, excerpt, trackbacks, custom-fields, comments, revisions, page-attributes, post-formats
'title',
'author',
'comments'
),
) );
}
/**
* Registers a Meta Box on our Series Custom Post Type, called 'Summary'
*/
function register_meta_boxes() {
// See: https://codex.wordpress.org/Function_Reference/add_meta_box
add_meta_box( 'series-summary', 'Series Summary', array( $this, 'output_meta_box' ), 'series', 'normal', 'high'); // $id, $title, $callback, $screen, $context, $priority
}
/**
* Output a Series Summary meta box
*
* @param WP_Post $post WordPress Post object
*/
function output_meta_box ( $post ) {
// Output label and field
echo ( '<label for="series_summary">' . __( 'Summary', 'sermon-manager-plus' ) . '</label>' );
echo ( '<input type="text" name="series_summary" id="series_summary" value="' . esc_attr( $email ) . '" />' );
}
}
$SermonManagerPlus = new SermonManagerPlus; // Create an object of type SermonManagerPlus.
?>
I've compared it several times to the tuts+ tutorial and for the life of me can't see what I'm doing wrong...Help!