Make WordPress Core

Ticket #23240: edit-form-test.php

File edit-form-test.php, 627 bytes (added by helen, 14 years ago)

Very simple plugin for testing

Line 
1<?
2add_action( 'edit_form_after_title', 'test_cpt_extra_fields' );
3add_action( 'edit_form_after_editor', 'test_cpt_extra_fields' );
4function test_cpt_extra_fields() {
5 if ( 'test-cpt' !== get_current_screen()->post_type )
6 return;
7
8?>
9<h3>Something</h3>
10<input type="text" class="widefat" />
11<?php
12}
13
14add_action( 'init', 'register_test_cpt', 1 );
15function register_test_cpt() {
16 register_post_type( 'test-cpt', array(
17 'label' => __('Test CPT'),
18 'public' => true,
19 'show_in_nav_menus' => false,
20 // comment items out for testing
21 'supports' => array(
22 //'title',
23 'editor',
24 'thumbnail',
25 'comments'
26 ),
27 ));
28}