$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>plugins - Show Post columns to specific users on condition|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

plugins - Show Post columns to specific users on condition

matteradmin10PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far