Remove post-type Wordpress Articles

0

Remove

I would like to remove the post-type Articles from the Wordpress menu I researched some possibilities but nothing worked.

I've tried creating the unregister_post_type method this way:

function unregister_post_type( $post_type ) {
    global $wp_post_types;
    if ( isset( $wp_post_types[ $post_type ] ) ) {
        unset( $wp_post_types[ $post_type ] );
        return true;
    }
    return false;
}
    
asked by anonymous 09.02.2015 / 21:38

2 answers

2

You need to add action for a function to be accepted by the wordpress core. Do not forget to by functions.php

function post_remove ()      //criando a função post_remove para remover o  menu item
{ 
   remove_menu_page('edit.php');
}

add_action('admin_menu', 'post_remove');   //adicionando action

Source: link

    
10.02.2015 / 20:34
1

The post_type articles actually refers to the standard post_type "posts" of WordPress. I find it very difficult for you to "unregister" it and go unpunished, because it is the basis upon which the whole system was created. Probably the sky will fall on your head and a hole will open on the ground ... (joking ...)

If you want to remove the menu there is a much simpler way of doing this which is, well, remove the menu:

remove_menu_page( 'edit.php' );

Ready! The menu is gone and the sky is still there ...

    
10.02.2015 / 20:27