質問

Just had some questions I hope someone can shed some light on. I am looking to restrict certain data on a WordPress page to certain users, there are lots of plugins that offer restricted content in some ways, but I am looking to only restrict very specific content on that page, not the whole page. Is there something I am missing or something I should look at?

Just to give some more information, we're working with custom post types and on one of the pages that show the custom pages, some of the data that is being pulled out (within appearance->editor, not actually the WordPress page) so I will need to be able to have some kind of access to if($userlevel == "something") {}.

Many thanks

役に立ちましたか?

解決

Nevermind It is actually quite easy, check the userlevel and restrict content, perhaps add a new role:-)

他のヒント

Think you can write simple plugin for this task or modify current theme. May be section [a link] http://codex.wordpress.org/Function_Reference#User_and_Author_Functions help you. Wordpress Codex have a lot of information and you find what you need to solve your task. As i understand you need to use functions like user_can, current_user_can, current_user_can_for_blog or get_role and add_role inside wordpress loop.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top