plugins - Show Post columns to specific users on condition

admin2025-06-03  2

I have a CPT called Topics. And admin or editor can only make topics and It can be assigned to authors. I have a meta box where there will be a list of authors and Admin/Editor can choose whom to assign the Topic. So the assigned topic will be used by authors to write the post. But what I wanted was to show only the Topics only to the author that I have assigned. If a post is assigned to author1 I don't want author2 to see to use that. So, the author name will be in meta box and in the Topic CPT column. So, my condition would be if($get_current_user == get_post_meta( $post_id, 'cruiser_writer_value_key', true )){ }

So as you can see in the picture. There are three users and I just want Author2 to see the post assigned to him. How can I hide the post columns to authors if it has not been assigned to them. But admin should see all the post.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748933256a314938.html

最新回复(0)