Wordpress - WordPress Settings and Configuration
Identify the error in this code snippet:
add_role('custom_role', 'Custom Role', [
'read' => true,
'edit_posts' => true
]);
if (current_user_can('custom_role')) {
echo 'Has custom role';
}