<?php
// force forms to have a thick border
function foo($data) {
?>
.pc_registration_form, .pc_login_form, .pc_custom_form {
border: 7px solid #aaa !important;
}
<?php
}
add_action('pc_custom_style_css', 'foo');
?>
pc_deleted_user
Perform actions after user deletion. Its data and meta have alredy been deleted.
Parameters
(int) user ID deleted
pc_import_form
Add fields into import form. Must comply with existing table code.
<?php
// send mail to imported users
function foo($users) {
foreach($users as $user_id => $data) {
if(!empty($data['email'])) {
wp_mail( ... ) // simplified code
}
}
}
add_action('pc_imported_users', 'foo');
?>
pc_pre_self_user_del
Perform an action right before a user self-deletes
Parameters
(int) user ID
pc_pre_user_delete
Perform actions before user is deleted. Data and metas are still reachable.
Parameters
(int) user ID to be deleted
Usage
<?php
// send goodbye mail before deleting
function foo($user_id) {
// get mail
global $pc_users;
$email = $pc_users->get_user_field($user_id, 'email');
if(!empty($email)) {
wp_mail( ... ) // simplified code
}
}
add_action('pc_pre_user_delete', 'foo');
?>
pc_pre_user_update
Perform an action right before user is updated
Parameters
(int) user ID
(array) update query array
pc_pvt_page_comments_template
Give the opportunity to override comments template on users private page. Must return a path to the new commenta template.
pc_pvt_page_display
Users private page is being displayed (triggered in the_content hook)
pc_registered_user
Perform an action when user successfully registers with a registration form.
Parameters
(int) newly registered user ID
(int) newly registered user status
Usage
<?php
// add a meta value for newly registered user
function foo($user_id, $status) {
global $pc_meta;
$pc_meta->add_meta($user_id, 'meta_key', 'meta_val');
}
add_action('pc_registered_user', 'foo', 10, 2);
?>
(array) associative array containing settings data (option_key => value)
Usage
<?php
// add a new cusomizable message to be used in custom codes
function foo($fdata) {
$val = (isset($fdata['custom_mess'])) ? $fdata['custom_mess'] : '';
?>
(array) associative array containing settings data (option_key => value)
Usage
<?php
// add contents related to a new settings tab named 'test'
function foo($fdata) {
$val = (isset($fdata['pc_my_option'])) ? $fdata['pc_my_option'] : '';
?>
Perform an action when pending user is enabled through change_status method.
Parameters
(int) activated user ID
Usage
<?php
// contact user via mail during activation
function foo($user_id) {
// get mail
global $pc_users;
$email = $pc_users->get_user_field($user_id, 'email');
if(!empty($email)) {
wp_mail( ... ) // simplified code
}
}
add_action('pc_user_activated', 'foo');
?>
pc_user_added
Perform an action when user is added into database.
Parameters
(int) inserted user ID
Usage
<?php
// contact new user via mail
function foo($user_id) {
// get mail
global $pc_users;
$email = $pc_users->get_user_field($user_id, 'email');
if(!empty($email)) {
wp_mail( ... ) // simplified code
}
}
add_action('pc_user_added', 'foo');
?>
pc_user_added_by_admin
Fired when user has been successfully added through the admin panel
Parameters
(int) user ID
pc_user_created_from_wp
Perform an action a new user is added starting from an existing WordPress user on admin side
Parameters
(int) newly created PrivateContent user ID
(int) WordPress user ID
pc_user_created_from_wp_register
Perform an action a new user is added starting from an existing WordPress user on website's frontend
Parameters
(int) newly created PrivateContent user ID
(int) WordPress user ID
pc_user_dashboard_save
Fired when user data is saved through the admin panel (user dashboard)
(int) true if the action is triggered on a newly added user, otherwise false
pc_user_detached_from_wp
Perform an action when user is detachecd from its WordPress mirror. Action is performed right before WP user deletion.
Parameters
(int) user ID
(int) mirror WP user ID
pc_user_login
Perform an action when user logs in
Parameters
(int) user ID
pc_user_logout
Perform an action when user logs out
Parameters
(int) user ID
pc_user_synced_with_wp
Perform an action when user is synced with a WordPress mirror user.
Parameters
(int) user ID
(int) mirror WP user ID
pc_user_updated
Perform an action when user is updated (any field or meta is updated)
Parameters
(int) user ID
Usage
<?php
// contact user if admin update its data
function foo($user_id) {
// get mail
global $pc_users;
$email = $pc_users->get_user_field($user_id, 'email');
if(!empty($email) && pc_user_logged(false) === false)) {
wp_mail( ... ) // simplified code
}
}
add_action('pc_user_updated', 'foo');
?>
pvtcont_init
Fires whenever PrivateContent elements are loaded. Ideally should be used instead of "init" or "wp_loaded" to write code involving PrivateContent elements