Register Book Post Type

WPTurbo » Snippets » Register Book Post Type
0

Created with:

Custom snippet Generator

Visibility: 

public

Creator: time2livelife

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
				function myplugin_register_book_post_type() {
    $args = array(
        'public' => true,
        'label'  => 'Books',
        'show_in_rest' => true,
        'template' => array(
            array( 'core/image', array(
                'align' => 'left',
            ) ),
            array( 'core/heading', array(
                'placeholder' => 'Add Author...',
            ) ),
            array( 'core/paragraph', array(
                'placeholder' => 'Add Description...',
            ) ),
        ),
    );
    register_post_type( 'book', $args );
}
add_action( 'init', 'myplugin_register_book_post_type' );

			

Register an account to save your snippets or go Pro to get more features.