PrivateContent User Data add-on

Documentation for v3.1 and later


Introduction

Before going through documentation chapters, thanks for purchasing PrivateContent User Data add-on and trusting LCweb!

Need further help?

Open a ticket

Need a customization?

Ask for a quotation

Installation

Once installed and activated you will be moved to the LCweb Dashboard.
It contains the summary of all LCweb projects with useful links and prompting you to validate them.

LC WP Dashboard

In fact you must link your domain with your license. The procedure is very quick:

  1. Go to the LCweb License Hub and register
  2. Login and navigate to the related product section
  3. Add a new license specifying the purchase code and the domain you will use it onto
  4. The system will give you an activation token

    LC Licenses Hub

  5. Use it in the LCweb Dashboard, on your website

Create Custom Fields

The add-on's core function is to create unlimited fields to store additional user data. You can create any field type except uploads, reserved to Files Manager add-on

Fields index

Each field index is unique and cannot be changed. If you delete a custom field also user's related data will be lost.
They follows worpress "sanitize title" scheme. Then can have only latin characters and dashes/underscores.

Single-option checkbox

It's a boolean selector. Then only yes/no option.
You can also choose to show it in disclaimers box: will be placed at the end of forms, detached from the rest.

Floating numbers subtype

Be careful with this: only english format is supported: with dot splitting decimals! (eg. 15.6 and not 15,6)

Numeric ranges

By default values are allowed from 0 to 100. You can also use floating numbers to target a specific range.

Custom regexp validation

This advanced method allows you to extend data validation using regular expressions. Will paass through PHP preg_match() function, use a valid format!

Placeholder

Displays a default text on text and textarea fields. Is useful to help users fill in the form.

Predefined choices (not for combo fields)

Starting from v3 you can now choose the default field value, just check the option you want to select

Combo Fields

Starting from v3.0 User Data introduces combo fields: this means you will be able to load specific dropdown/checkbox options depending on another target dropdown/checkbox value.

Composition type

By default a single value is asked and used for both option's value and label. You can also use the advanced mode, where is possible to differentiate them (eg. using IDs as values and related human-readable labels)

Fields in Users List

Every custom field can be displayed in users list.
Just use the "screen options" flap to toggle and sort them as you prefer!

User Dashboard - Field Sections

Having many custom fields the user dashboard might become very crowded.
They can be spilt in sections, maintaining a gread usability and rationality.

Data-Update Forms

Starting from v3, User Data add-on is the unique form builder for both Registration and Data-update forms because of the conditional fields engine. Data-update forms are meant to let already registered users to edit/add data. This means they WILL NOT be visible by unlogged users.

What does "conditional" mean? You are able to toggle fields/texts visibility basing on other user field values.
Everything in real time!

To know how to insert the forms into your pages, please check the following "shortcodes" chapter.

Custom Message

Allows you to override the default message in case of successfull form submission

Form redirect

Allows you to set a page/url where users will be redirected once form has been successfully filled and data saved

Admin notification (requires Mail Actions add-on)

User Data add-on integrates with another LCweb's add-on, Mail Actions. Going into its settings panel you'll be able to enable this notification system.

Basically you can inform admins when an user updates its data.

admin notification

Shortcodes

This add-on is natively integrated with with WordPress Block Editor (Gutenberg), Visual Composer, Elementor and Divi Builder.

Using them, you can skip the standard shortcode wizard and use the related PrivateContent tool.

For any other builder or using the old WordPress editor just open the PrivateContent shortcode wizard and select "PCUD - User's Data" or "PCUD - Data-update Form" or "PCUD - Conditional Block" from the shortcode's dropdown list.

Select the view you want to show and click on "insert".

User's Data Shortcode

Simply displays the logged user's data related to the chosen field. Displayed data is already managed to be human-readable.

[pcud-user-data f="username"]

Data-update Form Shortcode

Displays the chosen data-update form, remember it is uniquely visible and usable by logged users! WordPress admins will be able to fill the form to test it, but no data will be saved.

[pcud-form form="fluid" layout="" align="center"]

User's Data Shortcode

Selectively show/hide contents basing on a logged user's field value. For example you cann show contents only to customers having filled a field or having the ".com" domain in their e-mails.

[pcud-cond-block f="email" cond="like" val=".com"]... contents ...[/pcud-cond-block] 

Remember that "greater" and "lower" condition only work with numeric data. While "contains" will search for at least a correspondance in user's data

Forced Password Reset

You can force users to reset their passwords. This is an extra security and privacy measure.

In PrivateContent settings (main tab), there are two new fields.
First one defines the top warning text and the second one requires Mail Actions add-on and defines whether to force users having requested a password reset.

forced psw reset

You will be able to enable the system in "edit user" page and use it during users import.

Users forced to update their passwords will be promped by a modal lightbox in every website's page.
They can't navigate on the website unless they perform the reset.

Import System Integration

Once custom fields have been created, you can import user data creating a proper CSV.
Basic structure is the one explained in PrivateContent documentation, then you can import which fields you want.

As first you must use the interface to add fields and select data to import for each row

Count starts from 7, columns before are occupied by standard fields. In this image:

  • 7th CSV column is related to "test select" field
  • 8th to "test checkboxes"

CSV structure must reflects this setup: custom fields are not mandatory, you can leave them blank for some user for example but must reflect data type and validation.

For example if "test select" requires a number with maximum length of 2 digits, you can't import a value like 100.
A validation is performed before creating any user. At the moment is not possible to import multiple values in case of checkboxes fields.

You can also import multiple values for multi-choice fields. In the CSV field they must be split by a vertical line: "|"

Multilanguage

The plugin is 100% multilanguage for both front and back ends. If a translation of your language has been created, WordPress will automatically switch between languages.
Plus it is compatible with WPML, Polylang and qTranslate!

How to create a translation

If you have WPML + String Translation add-on or Polylang, you can simply scan the plugin and translate strings via its UI.

Otherwise: go in the plugin folder, you'll find a folder called "languages".
Inside you'll find the default.pot file. It contains english strings to be translated.

If you want to create or customize your language translation, follow these steps:

  1. Open the default.pot file with POedit
  2. Edit the catalog by inserting your data and setting translation's language
  3. Save the file with your language's i18n identifier and "pcud_ml-" prefix (the italian example is pcud_ml-it_IT)
  4. Go to the plugin folder ".. wp-content/plugins/private-content/languages" and paste and paste resulting .PO and .MO files

If you create new translations, please contact me at support@lcweb.it sending your .PO and .MO files.
Otherwise they will be lost in next updates. Thanks!

LCweb - Copyright © 2022 - All Rights Reserved