本文整理汇总了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."));
}
}