Jump to content

hiding some data in wordpress: methods to accomplish this


Recommended Posts

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, housenumer

 

Those sensible data should be hidden? for the non registered users of Participant database. see https://wordpress.org/plugins/participants-database/

 

Well – that Participants Database doesnt 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 . '" ]' );
?>

possible solutions,; we can make use use of a ?use PHP in the content? plugin or do this in a custom WP template.

 

question,  how would you solve this task!?

 

love to hear from you

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.