How to hide "General" Post-Setting tab but show "Reviews"

Posted in: Newspaper
Post count: 79

Hello,

I have a site with multiple authors and contributors. I don’t want certain user-levels to be able to change the post template or sidebars etc of the posts, so I have hidden the whole “Post settings” area, by making #td_post_theme_settings_metabox invisible to them.

However, I would still like to let them do reviews, so I am looking for a way to selectively hide the General Settings tab, but show the Review tab.

Would that be somehow possible? Thanks!

PS. Actually ideally I would like to show them the “source” “via” and “subtitle” fields too inside the general tab (just hide template, sidebars), but if that’s more difficult, it is OK to hide them.

Post count: 22421

Hello,

Unfortunately our theme does not have such capabilities. You will have to create them custom and there is no simple solution I can provide via the theme support. Sorry. Our theme uses the default user roles and capabilities of wordpress. If you want to alter theme, you can only do it with custom modification.

Thank you!

Post count: 79

I understand, it’s OK!
May I suggest something simple then perhaps? You could give a different ID to each row of the #td_post_theme_settings_metabox – that way we can selectively hide rows

Post count: 22421

Hi,

I will add this as a suggestion but it’s up to the developers if they will implement this or not. I cannot promise anything though. If this request becomes more popular, then we will consider implementing it into the theme.

Thank you!

Post count: 79

Hi,
Thanks, meanwhile, I managed to do it myself.
In case anybody else is interested in this, here is how you can do it.

First, on file Newspaper/includes/wp_booster/wp-admin/content-metaboxes/td_templates_settings.php change line 55 from if (current_user_can(‘publish_posts’)) to if (current_user_can(‘edit_posts’)). This means that the whole settings box is now visible to contributors.

Then, on file Newspaper/includes/wp_booster/wp-admin/content-metaboxes/td_set_post_settings.php you can add a custom class for example hidefromcontributor to the rows of the box that you wish to hide.

Lastly, you can set the class hidefromcontributor to have visibility=hidden selectively unless the logged in user is admin or author (or anything else you want).

So the complete box will only be visible to admins / authors, and all the lines that you don’t apply hidefromcontributor to them will also be visible by contributors.

Post count: 22421

Thank you for posting the solution.

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