Post settings: custom sidebar protection

Posted in: Newsmag
Post count: 69

Hi,
I’d like to disable or hide the custom sidebar selection combo which is displayed inside the Post settings section when writing a new post. I want to hide that combo to all user’s role (editors, authors, …) but the Administrator. This because that combo allows to remove sidebars still in use in the site and it could be very dangerous. I don’t want also that Authors or Editors can select a different sidebar from the one I selected as default. How I can get this behaviour?
I’ve tried using Adminimize plugin which allows enable/disable WordPress menù options but it doesn’t provide an option to hide only the custom sidebars selection combo; it rather allows only the hiding of the entire Post Settings section but in this way users loose also other useful features like the post templates selection, post subtitle,..
Tnx a lot in advance for any useful and precious advice

Giuseppe Maio

  • This topic was modified 10 years by gmaio.
  • This topic was modified 10 years by gmaio.
Post count: 6535

Hi

To keep the custom sidebar field available only for users with admin role you need to edit the td_set_post_settings.php file and add this condition like here: http://screencast.com/t/3aOEzwrLMN

Let me know how it goes.
Thanks!

  • This reply was modified 10 years by Andrei L..
Post count: 69

Hi,
thank you for your prompt reply! I’ve done your suggested edit to td_set_post_settings.php but, unfortunately it has no effect on custom bar hiding to non administrative users. What may have gone wrong?
Thanks
Giuseppe

Post count: 6535

Hi

Sorry about that, I indicated the wrong function.
Try to change the condition like here: http://screencast.com/t/YcimFCB4W It should work fine.

Let me know how it goes.
Thanks!

Post count: 69

Hi Andrei,
thank you very much indeed. Your snippet works fine!
Now I can rest assured, knowing that a user can’t play with or remove existent sidebars around the site!
Thanks!
Bye
Giuseppe

Post count: 69

Hi there,
the modifications you’ve indicated some time ago to the file Newsmag/includes/wp_booster/wp-admin/content-metaboxes/td_set_post_settings.php (as shown at http://screencast.com/t/YcimFCB4W) worked for me like a charm until the update of Newsmag theme to the Version 2.3.5. The purpose was and still is to hide the sidebar selection combo to every user but to administrator. Now, even if the suggested modification has been applied, it doesn’t work anymore and the sidebar selection combo is “dangerously” visible and selectable from everyone. This way one (author, editor, …) could remove a “vital” sidebar from the system! How can I get the correct behaviour?
I’m using a Newsmag Child theme with only this modification to my Newsmag-child/includes/wp_booster/wp-admin/content-metaboxes/td_set_post_settings.php
My site is at http://43b.60a.myftpupload.com/
Thanks in advance for any appreciated help.

Giuseppe Maio

  • This reply was modified 10 years by gmaio.
Post count: 6535

Hi

The file from booster platform can’t be overwritten via child theme. Please check our documentation about child theme support with the theme: https://forum.tagdiv.com/newsmag-child-theme-support/
Also in order to work add the code in the main theme file.

Thanks!

Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.