I’d like to know how to make these settings visible only to administrators, so authors can’t change them. I’ll post a screenshot to show exactly which options I’m referring to.
https://drive.google.com/file/d/1afHqyPhRqdCiW-Qvhn7pKWz3X3-1mJ0R/view?usp=sharing
Thank you
Hi,
The theme panel is available only to admins.
But if you are referring to the post settings from the post edit screen -> https://prnt.sc/LntDAe_ddVEO those will be available for authors, editors, and admins, meaning everyone that can publish posts based on their wordpress user role.
Would you like to hide the post settings from the post edit screen for everyone but admins? I could try to provide a code solution, because it isn’t possible with options. Normally the post settings should be available for users that can publish posts, authors and above.
Let me know.
Thank you!
Then you could try a code like this one:
add_action( 'add_meta_boxes', 'tu_remove_meta_boxes', 999 );
function tu_remove_meta_boxes() {
if ( ! current_user_can( 'manage_options' ) ) {
remove_meta_box( 'td_post_theme_settings_metabox', 'post', 'normal' );
}
}
It can be loaded as a PHP code snippet with a code plugin like this one https://wordpress.org/plugins/insert-headers-and-footers/
Or it can be loaded in a child theme functions file.
It could be loaded in the main theme functions file as well, but this way it will be lost after a theme update and has to be entered again. The more permanent solutions is with a code plugin or child theme.
The code should remove the theme post settings for everyone but admins. You could test it.
Thank you!
