PATH:
home
/
lab2454c
/
aficbgroup.com
/
wp-content
/
plugins
/
ultimate-member
/
includes
/
core
<?php namespace um\core; if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'um\core\GDPR' ) ) { /** * Class Admin_GDPR * @package um\core */ class GDPR { /** * Admin_GDPR constructor. */ public function __construct() { add_action( 'um_submit_form_register', array( &$this, 'agreement_validation' ), 9, 2 ); add_filter( 'um_whitelisted_metakeys', array( &$this, 'extend_whitelisted' ), 10, 2 ); add_filter( 'um_before_save_filter_submitted', array( &$this, 'add_agreement_date' ) ); add_filter( 'um_email_registration_data', array( &$this, 'email_registration_data' ), 10, 1 ); add_action( 'um_after_form_fields', array( &$this, 'display_option' ) ); } /** * @param $args */ public function display_option( $args ) { if ( ! empty( $args['use_gdpr'] ) ) { $template_path = trailingslashit( get_stylesheet_directory() ) . '/ultimate-member/templates/gdpr-register.php'; if ( file_exists( $template_path ) ) { require $template_path; } else { require UM_PATH . 'templates/gdpr-register.php'; } } } /** * @param array $submitted_data * @param array $form_data */ public function agreement_validation( $submitted_data, $form_data ) { $gdpr_enabled = get_post_meta( $form_data['form_id'], '_um_register_use_gdpr', true ); $use_gdpr_error_text = get_post_meta( $form_data['form_id'], '_um_register_use_gdpr_error_text', true ); $use_gdpr_error_text = ! empty( $use_gdpr_error_text ) ? $use_gdpr_error_text : __( 'Please agree privacy policy.', 'ultimate-member' ); if ( $gdpr_enabled && ! isset( $submitted_data['submitted']['use_gdpr_agreement'] ) ) { UM()->form()->add_error( 'use_gdpr_agreement', $use_gdpr_error_text ); } } /** * @param array $metakeys * @param array $form_data */ public function extend_whitelisted( $metakeys, $form_data ) { $gdpr_enabled = get_post_meta( $form_data['form_id'], '_um_register_use_gdpr', true ); if ( ! empty( $gdpr_enabled ) ) { $metakeys[] = 'use_gdpr_agreement'; } return $metakeys; } /** * @param $submitted * * @return mixed */ public function add_agreement_date( $submitted ) { if ( isset( $submitted['use_gdpr_agreement'] ) ) { $submitted['use_gdpr_agreement'] = current_time( 'mysql', true ); } return $submitted; } /** * @param $submitted * * @return mixed */ public function email_registration_data( $submitted ) { if ( ! empty( $submitted['use_gdpr_agreement'] ) ) { $title = __( 'GDPR Applied', 'ultimate-member' ); $submitted[ $title ] = wp_date( get_option( 'date_format', 'F j, Y' ) . ' ' . get_option( 'time_format', 'g:i a' ), strtotime( $submitted['use_gdpr_agreement'] ) ); unset( $submitted['use_gdpr_agreement'] ); } return $submitted; } } }
[-] um-filters-account.php
[edit]
[-] um-actions-login.php
[edit]
[-] um-actions-misc.php
[edit]
[-] class-access.php
[edit]
[-] class-plugin-updater.php
[edit]
[-] um-filters-fields.php
[edit]
[-] class-options.php
[edit]
[-] um-filters-profile.php
[edit]
[-] class-profile.php
[edit]
[-] class-fonticons.php
[edit]
[-] class-member-directory-meta.php
[edit]
[+]
..
[-] um-filters-commenting.php
[edit]
[-] class-permalinks.php
[edit]
[-] class-member-directory.php
[edit]
[-] class-templates.php
[edit]
[-] class-setup.php
[edit]
[-] class-rewrite.php
[edit]
[-] um-filters-navmenu.php
[edit]
[-] class-date-time.php
[edit]
[-] class-blocks.php
[edit]
[-] um-actions-account.php
[edit]
[-] um-filters-avatars.php
[edit]
[-] class-external-integrations.php
[edit]
[-] um-actions-register.php
[edit]
[-] um-actions-save-profile.php
[edit]
[-] class-builtin.php
[edit]
[-] um-actions-access.php
[edit]
[-] um-filters-files.php
[edit]
[-] class-user-posts.php
[edit]
[-] um-filters-user.php
[edit]
[-] class-multisite.php
[edit]
[-] class-gdpr.php
[edit]
[-] class-account.php
[edit]
[-] class-roles-capabilities.php
[edit]
[-] um-actions-profile.php
[edit]
[-] class-files.php
[edit]
[-] um-actions-ajax.php
[edit]
[-] um-actions-wpadmin.php
[edit]
[-] class-form.php
[edit]
[-] class-ajax-common.php
[edit]
[-] um-filters-login.php
[edit]
[-] class-register.php
[edit]
[-] class-fields.php
[edit]
[-] class-user.php
[edit]
[-] class-password.php
[edit]
[-] um-actions-core.php
[edit]
[-] um-actions-global.php
[edit]
[-] class-mail.php
[edit]
[-] class-cron.php
[edit]
[-] class-validation.php
[edit]
[-] class-logout.php
[edit]
[-] class-shortcodes.php
[edit]
[-] um-actions-user.php
[edit]
[-] class-login.php
[edit]
[+]
rest
[-] class-uploader.php
[edit]
[-] um-actions-form.php
[edit]
[-] class-query.php
[edit]
[-] um-filters-misc.php
[edit]