Ends in
00Days
00Hours
00Mins
00Secs
Save up to 50%

PrivateContent Plugin

API Documentation

Database Tables

pc_users

#

PrivateContent stores data in two database tables: pc_users for users main data and pc_user_meta for their meta data. Just like WordPress does with posts. Tables use the WordPress prefix: get their full name through the PC_USERS_TABLE and PC_META_TABLE constants.

Prefer the plugin classes to direct queries: they validate data, manage serialization and trigger hooks.

Columns

ColumnDescription
iduser ID (auto increment)
insert_dateregistration date. Datetime related to the WordPress timezone
nameuser name - max 150 characters
surnameuser surname - max 150 characters
usernameuser username - max 150 characters. Unicity is granted by the plugin validation, not by a database key
pswpassword hash created through wp_hash_password(). Check it only through wp_check_password()
categoriesserialized array of user category IDs, stored as strings (eg. a:2:{i:0;s:1:"2";i:1;s:1:"5";})
emailuser e-mail - max 255 characters
teluser telephone - max 20 characters
page_iduser private page ID (pg_user_page post type)
wp_user_idID of the WordPress user synced with the PrivateContent one (0 = no user synced)
disable_pvt_page1 if the user private page is disabled, otherwise 0
last_accesslast login date. Datetime related to the WordPress timezone. 1970-01-01 00:00:01 means the user never logged in
statususer status: 1 = enabled, 2 = disabled, 3 = pending

pc_user_meta

#

Feel free to store anything you need into the meta table using the related class. It supports also arrays and objects (they are serialized).

The table has no unique key on user ID + meta key: always use the class methods, they prevent duplicated records.

Columns

ColumnDescription
meta_idmeta data ID (auto increment)
user_idID of the user the meta belongs to
meta_keymeta key - max 255 characters
meta_valuemeta value (string, number or serialized array/object)

Related WordPress entities

#

PrivateContent uses also standard WordPress entities:

EntityDescription
pg_user_categoriestaxonomy containing user categories
pc_reg_formtaxonomy containing registration forms. The form structure is stored in the term description
pg_user_pagepost type containing users private pages (one for each user)
pg_restrictionspost meta containing a post restrictions. Read them through get_post_restr()
pc_restrictionsterm meta containing a term restrictions. Read them through get_term_restr()
pc_user_idWordPress user meta storing the ID of the PrivateContent user a WP user is synced with
pg_*plugin settings are stored as WordPress options prefixed with pg_

Let's get in touch!

Features list