Hide add listing from non vendors

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;
	}
);

Hi,

Please note that this PHP snippet hides the Add Listing button from regular users. This button should be available for vendors.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.