In the app> admin.php I thought for sure the following would accomplish that, but, as you can see by the previous screen shot, it did not work.
add_action( 'remove_page_editor', function () {
function disable_mission_page_editor( ) {
if ( is_singular( 'mission' ) ) {
remove_post_type_support('page', 'editor');
} else {
return true;
}
}
} );
In the template page, I have tried to run the following function to dump the screen object, so that I may see what is ‘under the hood,’ so to say, but nothing.
function see_what_is_on_d_screen() {
$currentScreen = get_current_screen();
var_dump($currentScreen);
}
Basically what I would like to happen, is that, an editor logins into wp-admin, selects the mission page to edit and proceeds to not view the page settings or the generic editor, but to only see the ACF elements created for that specific template.
When you are creating field groups in ACFs GUI, there is a setting for hiding the editor on the screens where the field group is used. If you are using some kind of wrapper library for ACF, you should have the same option there.
With regards to your code: AFAIK there is no action named remove_page_editor so your function is never executed. Read more about hooks (filters and actions) here: https://developer.wordpress.org/plugins/hooks/
Even if your function had been executed, you have a function in the function so my guess is that the inner function will never be executed even if you would have had have a correct hook name. Removing the line function disable_mission_page_editor( ) { and the matching } would fix that.
I am still seeing the page settings and generic editor. I have yet to implement for only “editors” - I would like to see what it looks like if I ‘admin’ do not see them either.