Search
 
SCRIPT & CODE EXAMPLE
 

PHP

register_post_type wordpress

function create_custom_post_type() {
    register_post_type(
        'posttype', // post type name
        // CPT Options
        array(
            'labels' => array(
                'name' => __('Posttypes'), // title
                'singular_name' => __('Posttype') // editor right sidebar title
            ),
            'public' => true,
            'has_archive' => true,
            'show_in_rest' => true,
            'hierarchical' => true,
            'rewrite' => array('slug' => 'posttype'),
            'supports' => array(
                'title',
                'editor',
                'thumbnail',
                'page-attributes',
                'revisions',
                'trackbacks',
                'excerpt',
                'comments',
                'author',
            ),
            'capability_type' => 'post',
            'taxonomies' => array('category')
        )
    );
}
add_action('init', 'create_custom_post_type');
Comment

wordpress register post type

function book_setup_post_type() {
    $args = array(
        'public'    => true,
        'label'     => __( 'Books', 'textdomain' ),
        'menu_icon' => 'dashicons-book',
    );
    register_post_type( 'book', $args );
}
add_action( 'init', 'book_setup_post_type' );
Comment

PREVIOUS NEXT
Code Example
Php :: laravel redirect with message to section 
Php :: how to run specific migration in laravel 
Php :: total days between two dates carbon 
Php :: A non well formed numeric value encountered 
Php :: search post by post title in wordpres 
Php :: php scandir 
Php :: pass in php 
Php :: str_contains 
Php :: php year from date 
Php :: php begin 
Php :: add two numbers as string in php 
Php :: laravel csrf token mismatch postman 
Php :: alerta con php 
Php :: change minutes in to hours carbon 
Php :: laravel 8 route 
Php :: Clear php cache 
Php :: how see the list all artisan in laravel 
Php :: send attachment in mail php 
Php :: erreur php 
Php :: livewire inline component 
Php :: laravel store method 
Php :: convert single quote in htmlentities php 
Php :: the_post_thumbnail 
Php :: wordpress get page number 
Php :: collapse open by default 
Php :: install laravel in bootstrap 8 
Php :: how to set base url in codeigniter 
Php :: php if negative make positive 
Php :: how to rename uploaded file in codeigniter before upload 
Php :: Notice: Undefined variable: _SESSION in C:xampphtdocspracticeheader.php on line 7 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =