Skip Navigation

[Resolved] What's the Block Editor Panel Name for "Content Template"?

This support ticket is created 2 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 2 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#2388797
Screenshot 2022-06-20 at 10.42.57.png

Tell us what you are trying to do?
Remove Block Editor Sidebar Panel item "Content Template" with removeEditorPanel()

Is there any documentation that you are following?
In core, you find the panel name here hidden link
For example "Featured Image" is hidden link >

const PANEL_NAME = 'featured-image';

Then, once you have that name you can do removeEditorPanel('featured-image') to remove that panel from the Gutenberg sidebar,
I need to do the same for Content Template panel.

What is the name for the Content Template Panel?

#2388853

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Beda, Hope you are doing great.

I tried using the method removeEditorPanel() and it seems based on the code that the ID of the content template metabox is "views_template" but when I tried it does not seems to works.

However, I have workaround for you, here is the filter you can use and I checked it works:

add_filter('wpv_filter_wpv_disable_post_content_template_metabox', function($res, $post){
    if(get_post_type($post) == 'gym'){
        $res = true;
    }
    return $res;
}, 10, 2);

If you are strict to use Gutenberg method removeEditorPanel() then let me know I will check with Devs.