Editing post_type in wordpress

People here tell me… I bet a lot of time… How to register new post_type– this is clear through register_post_type($name,$args);

Here’s how to change post_typesuch as postand page.. for example, rename everything there via $labels = array( );or add exclude something there… via 'supports' => array('title','editor','custom-fields')


Answer 1, authority 100%

//       ...
function change_post_object_label() {
    global $wp_post_types;
    $labels = $wp_post_types['post']->labels;
    $labels->name = __('', 'new' );
    $labels->singular_name = __('', 'new' );
    $labels->add_new = __('', 'new' );
    $labels->add_new_item = __('', 'new' );
    $labels->edit_item = __(' ', 'new' );
    $labels->new_item = __(' ', 'new' );
    $labels->view_item = __(' ', 'new' );
    $labels->search_items = __(' ', 'new' );
    $labels->not_found = __('  ', 'new' );
    $labels->not_found_in_trash = __('  ', 'new' );
    $labels->menu_name = __('', 'new' );
    $labels->name_admin_bar = __('', 'new' );
    $labels->all_items = __(' ', 'new' );
}
add_action( 'init', 'change_post_object_label' );

Leave a reply

Please enter your comment!
Please enter your name here