Passing arguments into ‘init’ function

I’m new here, so please be kind.

I’m trying to pass an argument in to the ‘init’ hook (please see below for what I’m trying to do).

//define post type name
$pt_name = ‘post’;

//remove default wysiwyg editor
add_action(‘init’, function($pt_name) {
$post_type = $pt_name;
remove_post_type_support( $post_type, ‘editor’);
}, 100);

It seems $pt_name isn’t being passed in to the hook function correctly.

Any suggestions as to what to try fix this?

Thank you in advance

Read more here:: Passing arguments into ‘init’ function

Leave a Reply

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