Sauter la navigation

[Résolu] What's the Block Editor Panel Name for "Content Template"?

This support ticket is created Il y a 2 années et 7 mois. 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)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Minesh Il y a 2 années et 7 mois.

Assisté par: Minesh.

Auteur
Publications
#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 lien caché
For example "Featured Image" is lien caché >

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

Les langues: Anglais (English )

Fuseau horaire: 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.