Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Privacy::eraser( $email_address, int $page = 1 )
Eraser for Popup Maker Optin Form Subscriber Data.
Description Description
See also See also
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Parameters Parameters
- $email_address
-
(Required)
- $page
-
(Optional)
Default value: 1
Return Return
(array)
Source Source
File: classes/Privacy.php
public static function eraser( $email_address, $page = 1 ) { if ( empty( $email_address ) ) { return array( 'items_removed' => false, 'items_retained' => false, 'messages' => array(), 'done' => true, ); } $messages = array(); $items_removed = false; $items_retained = false; $number = 500; // Limit us to avoid timing out $page = (int) $page; $subscribers = PUM_DB_Subscribers::instance()->query( array( 's' => $email_address, 'page' => $page, 'limit' => $number, 'orderby' => 'ID', 'order' => 'ASC', ), 'ARRAY_A' ); foreach ( (array) $subscribers as $subscriber ) { if ( $subscriber['email'] == $email_address ) { // Data should not be deleted if the user was left subscribed to a service provider. $unsubscribed = apply_filters( 'pum_privacy_eraser_subscriber_was_unsubscribed', true, $email_address, $subscriber ); if ( $unsubscribed ) { $deleted = PUM_DB_Subscribers::instance()->delete( $subscriber['ID'] ); if ( $deleted ) { $items_removed = true; } else { $items_retained = true; $messages[] = __( 'Subscription information was not removed. A database error may have occurred during deletion.', 'popup-maker' ); } } else { $items_retained = true; $messages[] = __( 'Subscription information was not removed. This may occur when no immediate confirmation is received during our attempt to unsubscribe you from our mailing list.', 'popup-maker' ); } } } // Tell core if we have more comments to work on still $done = count( $subscribers ) < $number; return array( 'items_removed' => $items_removed, 'items_retained' => $items_retained, 'messages' => $messages, 'done' => $done, ); }
Expand full source code Collapse full source code View on Trac