使用具有类似$参数的get\\U posts或WP\\U查询:
$args = array(
\'post_type\' => \'your_custom_post_type\',
\'author\' => get_current_user_id(),
);
$wp_posts = get_posts($args);
if (count($wp_posts)) {
echo "Yes, the current user has \'your_custom_post_type\' posts published!";
} else {
echo "No, the current user does not have \'your_custom_post_type\' posts published.";
}