Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- abstract class MaraleWPTaoNFC {
- public static function pre_user_email_wpfilter( $raw_email ) {
- $email = sanitize_email($raw_email);
- if ( isset($_REQUEST['loginFacebook']) && $_REQUEST['loginFacebook'] == '1'
- && !email_exists( $email ) ) {
- self::fire_wptao_contact_event( $email, '',
- 'Rejestracja przez Facebook\'a',
- 'Nextend Facebook Connect'
- );
- remove_action( 'wp_login', 'wtbp_wptao_event_login_successful_fire', 10 );
- }
- return $raw_email;
- }
- private static function fire_wptao_contact_event( $email, $title='', $message='', $source='' ) {
- if ( is_admin() || empty( $email ) ) {
- return;
- }
- $user_data = array(
- 'email' => $email,
- 'options' => array(
- 'allow_no_fingerptint' => false,
- 'only_not_identified' => true
- )
- );
- $args = array(
- 'title' => __( 'Contact', WTBP_WPTAO_DOMAIN ),
- 'value' => $email,
- 'tags' => array( 'wp' ),
- 'meta' => array(
- 'title' => $title,
- 'message' => $message,
- 'source' => $source
- ),
- 'user_data' => $user_data
- );
- do_action( 'wptao_track_event', 'contact', $args );
- }
- }
- add_filter( 'pre_user_email', array( 'MaraleWPTaoNFC', 'pre_user_email_wpfilter' ) );
Add Comment
Please, Sign In to add comment