コード例 #1
0
 public static function purge_contact($contact_id)
 {
     $subscriber = EZP_CS_Subscriber_Entity::get_by_contact_id($contact_id);
     if ($subscriber != null) {
         $subscriber->delete();
     }
     $emails = EZP_Email_Entity::get_by_contact_id($contact_id);
     foreach ($email as $email) {
         /* @var $email EZP_Email_Entity */
         $email->delete();
     }
     EZP_Contact_Entity::delete_by_id($contact_id);
 }
コード例 #2
0
ファイル: class-ezp-cs.php プロジェクト: bqevin/wp-shopeasy
 function ws_purge_contact()
 {
     $request = stripslashes_deep($_REQUEST);
     if (isset($request['_wpnonce'])) {
         $_wpnonce = $request['_wpnonce'];
         if (wp_verify_nonce($_wpnonce, 'easy-pie-cs-change-subscribers')) {
             if (isset($request['contact_id'])) {
                 $contact_id = $request['contact_id'];
                 EZP_Contact_Entity::delete_by_id($contact_id);
             } else {
                 EZP_CS_Utility::debug("ws_purge_contact: contact id not set");
             }
         } else {
             EZP_CS_Utility::debug("ws_purge_contact: Security violation. Nonce doesn't properly match!");
         }
     } else {
         EZP_CS_Utility::debug("ws_purge_contact: Security violation. Nonce doesn't exist!");
     }
 }