I’m trying to unregister a post type from a child theme but I haven’t been able to do so, the code in the funcions.php file on the parent theme is something like this:

add_action( 'init', 'mc_projects' );
function mc_projects() {
    register_post_type( 'project', array(
        // Default options....
    ) );

}

What I tried to do in my child theme was to remove the mc_project action from the init hook like this:

remove_action('init', 'mc_projects', 11);

But it didn’t work, even when I set the priority to some higher value, am I doing something wrong?

5 Answers
5

Try the following in your child theme functions file.

add_action( 'init', 'remove_mc_projects' );
function remove_mc_projects() {
    remove_action('init', 'mc_projects');
}

Leave a Reply

Your email address will not be published. Required fields are marked *