本文整理匯總了PHP中SwpmUtils::account_delete_confirmation_ui方法的典型用法代碼示例。如果您正苦於以下問題:PHP SwpmUtils::account_delete_confirmation_ui方法的具體用法?PHP SwpmUtils::account_delete_confirmation_ui怎麽用?PHP SwpmUtils::account_delete_confirmation_ui使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SwpmUtils
的用法示例。
在下文中一共展示了SwpmUtils::account_delete_confirmation_ui方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: verify_and_delete_account
private function verify_and_delete_account()
{
include_once SIMPLE_WP_MEMBERSHIP_PATH . 'classes/class.swpm-members.php';
$delete_account = filter_input(INPUT_GET, 'delete_account');
if (empty($delete_account)) {
return;
}
$password = filter_input(INPUT_POST, 'account_delete_confirm_pass', FILTER_UNSAFE_RAW);
$auth = SwpmAuth::get_instance();
if (!$auth->is_logged_in()) {
return;
}
if (empty($password)) {
SwpmUtils::account_delete_confirmation_ui();
}
$nonce_field = filter_input(INPUT_POST, 'account_delete_confirm_nonce');
if (empty($nonce_field) || !wp_verify_nonce($nonce_field, 'swpm_account_delete_confirm')) {
SwpmUtils::account_delete_confirmation_ui(SwpmUtils::_("Sorry, Nonce verification failed."));
}
if ($auth->match_password($password)) {
$auth->delete();
wp_redirect(home_url());
exit(0);
} else {
SwpmUtils::account_delete_confirmation_ui(SwpmUtils::_("Sorry, Password didn't match."));
}
}