| 1 | <?
|
|---|
| 2 | add_action( 'edit_form_after_title', 'test_cpt_extra_fields' );
|
|---|
| 3 | add_action( 'edit_form_after_editor', 'test_cpt_extra_fields' );
|
|---|
| 4 | function 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 |
|
|---|
| 14 | add_action( 'init', 'register_test_cpt', 1 );
|
|---|
| 15 | function 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 | }
|
|---|