Display add listing to vendors only, this code restrict all users and vendors to add listing, i only want to allow vendors only to add listing, also i dont want to allow direct vendor registration.
add_filter(
'option_hp_listing_enable_submission',
function( $value ) {
if ( ! is_admin() && ! current_user_can( 'edit_posts' ) ) {
return false;
}
return $value;
}
);