hiding some data : methods to accomplish this ?
-
Hello dear developer, hello dear user,
i run a plugin that works as a job-database – it is a plugin that is called participant-databaae; this plugin shows up;
employer with their adress: applicants with their data ? but: there is a set of sensible data like
– e-mail-adress
– adress: town, street, housenumerThose sensible data should be hidden? for the non registered users of Participant database. Well – that Participants Database doesn?t have a special ?login?-feature: In other words: There is no way to know if someone is a registered user or not – unless they are logged in to a user account on the site.
If we want to hide fields from users that are not logged in, there are two ways to go: we can use either a custom template or a PHP shortcode snippet – something like this:
<?php $fields = 'first_name,last_name'; if ( is_user_logged_in() ) { $fields = 'first_name,last_name,email,address,city'; } echo do_shortcode( '[pdb_single fields="' . $fields . '" ]' ); ?>
we can make use use of a ?use PHP in the content? plugin or do this in a custom WP template.
- The topic ‘hiding some data : methods to accomplish this ?’ is closed to new replies.