• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wppb_required_field_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wppb_required_field_error函数的典型用法代码示例。如果您正苦于以下问题:PHP wppb_required_field_error函数的具体用法?PHP wppb_required_field_error怎么用?PHP wppb_required_field_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wppb_required_field_error函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wppb_check_username_value

function wppb_check_username_value($message, $field, $request_data, $form_location)
{
    global $wpdb;
    if ($field['required'] == 'Yes') {
        if (isset($request_data['username']) && trim($request_data['username']) == '' || $form_location == 'register' && !isset($request_data['username'])) {
            return wppb_required_field_error($field["field-title"]);
        }
    }
    if (!empty($request_data['username'])) {
        if ($form_location == 'register') {
            $search_by_user_login = get_users('search=' . $request_data['username']);
        }
        if (!empty($search_by_user_login)) {
            return __('This username already exists.', 'profile-builder') . '<br/>' . __('Please try a different one!', 'profile-builder');
        }
        if (!validate_username($request_data['username'])) {
            return __('This username is invalid because it uses illegal characters.', 'profile-builder') . '<br/>' . __('Please enter a valid username.', 'profile-builder');
        }
        $wppb_generalSettings = get_option('wppb_general_settings');
        if ($wppb_generalSettings['emailConfirmation'] == 'yes') {
            if (is_multisite() && $request_data['username'] != preg_replace('/\\s+/', '', $request_data['username'])) {
                return __('This username is invalid because it uses illegal characters.', 'profile-builder') . '<br/>' . __('Please enter a valid username.', 'profile-builder');
            }
            $userSignup = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "signups WHERE user_login = %s", $request_data['username']));
            if (!empty($userSignup)) {
                return __('This username is already reserved to be used soon.', 'profile-builder') . '<br/>' . __('Please try a different one!', 'profile-builder');
            }
        }
    }
    return $message;
}
开发者ID:ksan5835,项目名称:rankproperties,代码行数:31,代码来源:username.php


示例2: wppb_check_email_value

function wppb_check_email_value($message, $field, $request_data, $form_location)
{
    global $wpdb;
    if (isset($request_data['email']) && trim($request_data['email']) == '' && $field['required'] == 'Yes') {
        return wppb_required_field_error($field["field-title"]);
    }
    if (isset($request_data['email']) && !is_email(trim($request_data['email']))) {
        return __('The email you entered is not a valid email address.', 'profilebuilder');
    }
    if (is_multisite() || !is_multisite() && (isset($wppb_generalSettings['emailConfirmation']) && $wppb_generalSettings['emailConfirmation'] == 'yes')) {
        $user_signup = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "signups WHERE user_email = %s", $request_data['email']));
        if (!empty($user_signup)) {
            return __('This email is already reserved to be used soon.', 'profilebuilder') . '<br/>' . __('Please try a different one!', 'profilebuilder');
        }
    }
    $users = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->users} WHERE user_email = %s", $request_data['email']));
    if (!empty($users)) {
        if ($form_location == 'register') {
            return __('This email is already in use.', 'profilebuilder') . '<br/>' . __('Please try a different one!', 'profilebuilder');
        }
        if ($form_location == 'edit_profile') {
            $current_user = wp_get_current_user();
            foreach ($users as $user) {
                if ($user->ID != $current_user->ID) {
                    return __('This email is already in use.', 'profilebuilder') . '<br/>' . __('Please try a different one!', 'profilebuilder');
                }
            }
        }
    }
    return $message;
}
开发者ID:DarussalamTech,项目名称:aims_prj,代码行数:31,代码来源:email.php


示例3: wppb_check_description_value

function wppb_check_description_value($message, $field, $request_data, $form_location)
{
    if (isset($request_data['description']) && trim($request_data['description']) == '' && $field['required'] == 'Yes') {
        return wppb_required_field_error($field["field-title"]);
    }
    return $message;
}
开发者ID:DarussalamTech,项目名称:aims_prj,代码行数:7,代码来源:description.php


示例4: wppb_check_radio_value

function wppb_check_radio_value($message, $field, $request_data, $form_location)
{
    if ($field['field'] == 'Radio') {
        if (!isset($request_data[wppb_handle_meta_name($field['meta-name'])]) && $field['required'] == 'Yes') {
            return wppb_required_field_error($field["field-title"]);
        }
    }
    return $message;
}
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:9,代码来源:radio.php


示例5: wppb_check_yim_value

function wppb_check_yim_value($message, $field, $request_data, $form_location)
{
    if ($field['required'] == 'Yes') {
        if (isset($request_data['yim']) && trim($request_data['yim']) == '' || !isset($request_data['yim'])) {
            return wppb_required_field_error($field["field-title"]);
        }
    }
    return $message;
}
开发者ID:RuseHackV2,项目名称:Go-Out,代码行数:9,代码来源:yim.php


示例6: wppb_check_toa_value

function wppb_check_toa_value($message, $field, $request_data, $form_location)
{
    if ($field['field'] == 'Checkbox (Terms and Conditions)') {
        if ($form_location == 'register') {
            if (isset($request_data[wppb_handle_meta_name($field['meta-name'])]) && trim($request_data[wppb_handle_meta_name($field['meta-name'])]) == '' && $field['required'] == 'Yes' || !isset($request_data[wppb_handle_meta_name($field['meta-name'])]) && $field['required'] == 'Yes') {
                return wppb_required_field_error($field["field-title"]);
            }
        }
    }
    return $message;
}
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:11,代码来源:checkbox-toa.php


示例7: wppb_check_input_value

function wppb_check_input_value($message, $field, $request_data, $form_location)
{
    if ($field['field'] == 'Input') {
        if ($field['required'] == 'Yes') {
            if (isset($request_data[wppb_handle_meta_name($field['meta-name'])]) && trim($request_data[wppb_handle_meta_name($field['meta-name'])]) == '' || !isset($request_data[wppb_handle_meta_name($field['meta-name'])])) {
                return wppb_required_field_error($field["field-title"]);
            }
        }
    }
    return $message;
}
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:11,代码来源:input.php


示例8: wppb_ecf_check_email_value

function wppb_ecf_check_email_value($message, $field, $request_data, $form_location)
{
    if ($field['field'] == 'Email Confirmation') {
        if (isset($request_data['wppb_email_confirmation']) && trim($request_data['wppb_email_confirmation']) == '' && $field['required'] == 'Yes') {
            return wppb_required_field_error($field["field-title"]);
        }
        if (isset($request_data['wppb_email_confirmation']) && $field['required'] == 'Yes' && $request_data['email'] != $request_data['wppb_email_confirmation']) {
            return __('The email confirmation does not match your email address.', 'profilebuilder');
        }
    }
    return $message;
}
开发者ID:seanlon,项目名称:profile-page,代码行数:12,代码来源:index.php


示例9: wppb_check_repeat_password_value

function wppb_check_repeat_password_value($message, $field, $request_data, $form_location)
{
    if ($form_location == 'register') {
        if (isset($request_data['passw2']) && trim($request_data['passw2']) == '' && $field['required'] == 'Yes') {
            return wppb_required_field_error($field["field-title"]);
        } elseif (!isset($request_data['passw2']) && $field['required'] == 'Yes') {
            return wppb_required_field_error($field["field-title"]);
        } elseif (isset($request_data['passw1']) && isset($request_data['passw2']) && trim($request_data['passw1']) != trim($request_data['passw2']) && $field['required'] == 'Yes') {
            return __("The passwords do not match", "profilebuilder");
        }
    } elseif ($form_location == 'edit_profile') {
        if (isset($request_data['passw1']) && isset($request_data['passw2']) && trim($request_data['passw1']) != trim($request_data['passw2'])) {
            return __("The passwords do not match", "profilebuilder");
        }
    }
    return $message;
}
开发者ID:eugene-gromky-co,项目名称:mindfulnesssummit,代码行数:17,代码来源:password-repeat.php


示例10: wppb_check_phone_value

function wppb_check_phone_value($message, $field, $request_data, $form_location)
{
    if ($field['field'] == 'Phone') {
        if ($field['required'] == 'Yes') {
            if (isset($request_data[wppb_handle_meta_name($field['meta-name'])]) && trim($request_data[wppb_handle_meta_name($field['meta-name'])]) == '' || !isset($request_data[wppb_handle_meta_name($field['meta-name'])])) {
                return wppb_required_field_error($field["field-title"]);
            }
        }
        if (!empty($field['phone-format'])) {
            $is_phone_error = wppb_check_phone_number_format($field, $request_data);
            if (!empty($is_phone_error)) {
                return wppb_phone_field_error($field["field-title"]);
            }
        }
    }
    return $message;
}
开发者ID:alvarpoon,项目名称:aeg,代码行数:17,代码来源:phone.php


示例11: wppb_check_password_value

function wppb_check_password_value($message, $field, $request_data, $form_location)
{
    if ($form_location == 'register') {
        if (isset($request_data['passw1']) && trim($request_data['passw1']) == '' && $field['required'] == 'Yes') {
            return wppb_required_field_error($field["field-title"]);
        } elseif (!isset($request_data['passw1']) && $field['required'] == 'Yes') {
            return wppb_required_field_error($field["field-title"]);
        }
    }
    if (trim($request_data['passw1']) != '') {
        $wppb_generalSettings = get_option('wppb_general_settings');
        if (wppb_check_password_length($request_data['passw1'])) {
            return '<br/>' . sprintf(__("The password must have the minimum length of %s characters", "profile-builder"), $wppb_generalSettings['minimum_password_length']);
        }
        if (wppb_check_password_strength()) {
            return '<br/>' . sprintf(__("The password must have a minimum strength of %s", "profile-builder"), wppb_check_password_strength());
        }
    }
    return $message;
}
开发者ID:RuseHackV2,项目名称:Go-Out,代码行数:20,代码来源:password.php


示例12: wppb_check_user_role_value

function wppb_check_user_role_value($message, $field, $request_data, $form_location)
{
    if ($form_location == 'back_end') {
        return;
    }
    $field['meta-name'] = 'custom_field_user_role';
    if ($field['field'] == 'Select (User Role)') {
        if ($field['required'] == 'Yes') {
            if (isset($request_data[wppb_handle_meta_name($field['meta-name'])]) && trim($request_data[wppb_handle_meta_name($field['meta-name'])]) == '' || !isset($request_data[wppb_handle_meta_name($field['meta-name'])])) {
                return wppb_required_field_error($field["field-title"]);
            }
        }
        if (isset($field['user-roles']) && isset($request_data['custom_field_user_role'])) {
            $available_user_roles = explode(', ', $field['user-roles']);
            if (!in_array($request_data['custom_field_user_role'], $available_user_roles)) {
                return __('You cannot register this user role', 'profile-builder');
            }
        }
    }
    return $message;
}
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:21,代码来源:user-role.php


示例13: wppb_check_validation_value

function wppb_check_validation_value($message, $field, $request_data, $form_location)
{
    if ($form_location != 'register') {
        return $message;
    }
    if ($field['field'] == 'Validation') {
        // Field must not be empty
        if (isset($request_data[wppb_handle_meta_name($field['meta-name'])]) && trim($request_data[wppb_handle_meta_name($field['meta-name'])]) == '' || !isset($request_data[wppb_handle_meta_name($field['meta-name'])])) {
            return wppb_required_field_error($field["field-title"]);
        }
        // Check if the provided value matches the allowable values
        if (!empty($field['validation-possible-values'])) {
            $allowed_values = explode(',', $field['validation-possible-values']);
            if (!in_array($request_data[wppb_handle_meta_name($field['meta-name'])], $allowed_values)) {
                if (!empty($field['custom-error-message'])) {
                    return $field['custom-error-message'];
                } else {
                    return wppb_required_field_error($field["field-title"]);
                }
            }
        }
    }
    return $message;
}
开发者ID:alvarpoon,项目名称:aeg,代码行数:24,代码来源:validation.php


示例14: wppb_check_multiple_select_value

function wppb_check_multiple_select_value($message, $field, $request_data, $form_location)
{
    if ($field['field'] == 'Select (Multiple)') {
        if (isset($request_data[wppb_handle_meta_name($field['meta-name'])])) {
            $selected_values = '';
            foreach ($request_data[wppb_handle_meta_name($field['meta-name'])] as $key => $value) {
                $selected_values .= $value . ',';
            }
            if ($field['required'] == 'Yes' && trim($selected_values, ',') == '') {
                return wppb_required_field_error($field["field-title"]);
            }
        }
    }
    return $message;
}
开发者ID:alvarpoon,项目名称:aeg,代码行数:15,代码来源:select-multiple.php


示例15: wppb_check_map_value

function wppb_check_map_value($message, $field, $request_data, $form_location)
{
    if ($field['field'] == 'Map') {
        // Validate the coordinates
        $error = false;
        if (!empty($request_data[wppb_handle_meta_name($field['meta-name'])])) {
            foreach ($request_data[wppb_handle_meta_name($field['meta-name'])] as $position) {
                $position = explode(',', $position);
                // We should only have a latitude and longitude
                if (count($position) != 2) {
                    $error = true;
                }
                if (strpos($position[0], '.') === false || strpos($position[1], '.') === false) {
                    $error = true;
                }
            }
        }
        if ($error) {
            return __('Something went wrong. Please try again.', 'profile-builder');
        }
        // Check to see if required
        if ($field['required'] == 'Yes') {
            if (isset($request_data[wppb_handle_meta_name($field['meta-name'])]) && empty($request_data[wppb_handle_meta_name($field['meta-name'])]) || !isset($request_data[wppb_handle_meta_name($field['meta-name'])])) {
                return wppb_required_field_error($field["field-title"]);
            }
        }
    }
    return $message;
}
开发者ID:alvarpoon,项目名称:aeg,代码行数:29,代码来源:map.php


示例16: wppb_check_timepicker_value

function wppb_check_timepicker_value($message, $field, $request_data, $form_location)
{
    if ($field['field'] == 'Timepicker') {
        if ($field['required'] == 'Yes') {
            if (isset($request_data[wppb_handle_meta_name($field['meta-name'])]) && (empty($request_data[wppb_handle_meta_name($field['meta-name'])]['hours']) || empty($request_data[wppb_handle_meta_name($field['meta-name'])]['minutes'])) || !isset($request_data[wppb_handle_meta_name($field['meta-name'])])) {
                return wppb_required_field_error($field["field-title"]);
            }
        }
    }
    return $message;
}
开发者ID:alvarpoon,项目名称:aeg,代码行数:11,代码来源:timepicker.php


示例17: wppb_check_checkbox_value

function wppb_check_checkbox_value($message, $field, $request_data, $form_location)
{
    if ($field['field'] == 'Checkbox') {
        $checked_values = '';
        if (isset($request_data[wppb_handle_meta_name($field['meta-name'])])) {
            $checked_values = implode(',', $request_data[wppb_handle_meta_name($field['meta-name'])]);
        }
        if ($field['required'] == 'Yes' && empty($checked_values)) {
            return wppb_required_field_error($field["field-title"]);
        }
    }
    return $message;
}
开发者ID:alvarpoon,项目名称:aeg,代码行数:13,代码来源:checkbox.php


示例18: wppb_check_recaptcha_value

function wppb_check_recaptcha_value($message, $field, $request_data, $form_location)
{
    if ($field['field'] == 'reCAPTCHA') {
        if ($form_location == 'register' && isset($field['captcha-pb-forms']) && strpos($field['captcha-pb-forms'], 'pb_register') !== false) {
            if (wppb_validate_captcha_response(trim($field['public-key']), trim($field['private-key'])) == false && $field['required'] == 'Yes') {
                return wppb_required_field_error($field["field-title"]);
            }
        }
    }
    return $message;
}
开发者ID:alvarpoon,项目名称:aeg,代码行数:11,代码来源:recaptcha.php



注:本文中的wppb_required_field_error函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wpr_random_tags函数代码示例发布时间:2022-05-23
下一篇:
PHP wppb_notify_user_registration_email函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap