Extra removal of editor panels
This commit is contained in:
parent
e8894b5db7
commit
2645b09ea3
2
js/block-editor.min.js
vendored
2
js/block-editor.min.js
vendored
@ -1 +1 @@
|
||||
wp.domReady((function(){setTimeout((()=>{document.querySelectorAll("label").forEach((e=>{"Stick to the top of the blog"===e.textContent&&(fictioneerData.userCapabilities?.fcn_make_sticky||e.closest(".components-panel__row").remove()),"Allow pingbacks & trackbacks"===e.textContent&&e.closest(".components-panel__row").remove()}))}),200)}));
|
||||
wp.domReady((()=>{fictioneerData.userCapabilities?.manage_options||wp.data.dispatch("core/edit-post").removeEditorPanel("page-attributes"),fictioneerData.userCapabilities?.fcn_edit_permalink||wp.data.dispatch("core/edit-post").removeEditorPanel("post-link"),fictioneerData.userCapabilities?.fcn_select_page_template||wp.data.dispatch("core/edit-post").removeEditorPanel("template")})),wp.domReady((function(){setTimeout((()=>{document.querySelectorAll("label").forEach((e=>{"Stick to the top of the blog"===e.textContent&&(fictioneerData.userCapabilities?.fcn_make_sticky||e.closest(".components-panel__row").remove()),"Allow pingbacks & trackbacks"===e.textContent&&e.closest(".components-panel__row").remove()}))}),200)}));
|
@ -3,6 +3,27 @@
|
||||
// RESTRICT EDITOR ELEMENTS (ENGLISH ONLY)
|
||||
// =============================================================================
|
||||
|
||||
// https://github.com/WordPress/gutenberg/tree/trunk/packages/edit-post/src/components/sidebar
|
||||
|
||||
wp.domReady(() => {
|
||||
// Page attributes
|
||||
if (!fictioneerData.userCapabilities?.manage_options) {
|
||||
wp.data.dispatch('core/edit-post').removeEditorPanel('page-attributes');
|
||||
}
|
||||
|
||||
// Permalink
|
||||
if (!fictioneerData.userCapabilities?.fcn_edit_permalink) {
|
||||
wp.data.dispatch('core/edit-post').removeEditorPanel('post-link');
|
||||
}
|
||||
|
||||
// Template
|
||||
if (!fictioneerData.userCapabilities?.fcn_select_page_template) {
|
||||
wp.data.dispatch('core/edit-post').removeEditorPanel('template');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
wp.domReady(function() {
|
||||
|
||||
setTimeout(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user