Is there possible way to modify custom post type?

I use a third party plugin and plugin has created a custom post type called “creations”.

Bu there is no archive page, there is no single page, there is no admin menu page… But data are saving on database correctly.

Is there a possible way to the active admin menu, archive page & single page?

Other all behaviours of custom post type should be there like( Eg: if exclude_from_search is true, this shouldn’t change)

2 Answers
2

You can change register_post_type() arguments before the new type is created. To do this, use the register_post_type_args filter.

add_filter( 'register_post_type_args', 'se342540_change_post_type_args', 10, 2 );
function se342540_change_post_type_args( $args, $post_name )
{
    if ( $post_name != 'cpt_slug' )
        return $args;

    $args['has_archive'] = true;
    // 
    // other arguments

    return $args;
}

Leave a Comment