Developers

Hooks and filters available for developers to extend plugin functionality. All snippets on this page belong in your child theme’s functions.php file, in a custom plugin, or in a code-snippets plugin.

How to Check User Verification Status?

Use the following code to check if a user has verified their email:

if ( function_exists( 'cev_pro' ) && cev_pro()->function->is_user_email_verified( $user_id ) ) {
    // User is verified.
}

This helper returns true both for a fully verified customer and for one who has verified their email but is still awaiting their first paid order, which is the state used when Paid-Order Gatekeeping is enabled. It is therefore the correct check for any access, prompt or gating decision.

To read the raw state instead, the user-meta key is customer_email_verified and its value is one of true, pending_paid_order or false:

$state = get_user_meta( $user_id, 'customer_email_verified', true );
These are strings, not booleans
customer_email_verified is stored as the literal strings ‘true’, ‘pending_paid_order’, or ‘false’ — never as a PHP boolean. A comparison like === false will never match, since the stored value is the string ‘false’. Compare against the string directly ($state === ‘false’) or, better, use is_user_email_verified() / cev_pro_is_pending_paid_order() above instead of reading the meta yourself.

Available Actions

The plugin’s core (outside Smart Form) fires one general-purpose action:

do_action( 'cev_paid_order_gatekeeping_completed', $user_id, $source );
// $source is 'paid_order' (customer's first paid order completed)
// or 'admin' (an admin used Force activate).

Fires when a pending paid order customer is promoted to fully verified, so your own coupon, marketing-list, or membership integrations can release anything they were holding back. See Settings for how Paid-Order Gatekeeping works.

How to Change the OTP Button Label?

Use this filter to customize the “Send Verification Code” button text on the checkout verification form:

add_filter( 'cev_get_otp_button_text', function ( $text ) {
    return 'Get Your Code';
} );

Available Filters

FilterParametersSinceDescription
cev_get_otp_button_text$button_textNot documented in codeChange the text of the checkout “Send Verification Code” button.
cev_verification_code_length$code_label, $code_lengthNot documented in codeChanges only the code-length label shown in the verification popup (e.g. “4-digit code”) — it does not change the actual OTP length, which is a separate admin setting. See the warning below.
cev_login_auth_message$message, $emailNot documented in codeChange the message shown in the login authentication popup.
cev_resend_limit_message$messageNot documented in codeChange the message shown when a customer reaches the resend limit.
cev_email_from_name$from_name, $context2.8.6Change the From name used on verification emails.
cev_email_from_address$from_address, $context2.8.6Change the From address used on verification emails.
cev_back_office_roles$roles (array), $user (WP_User)2.10.0Change which roles are treated as store staff and exempted from verification. Return the full array of exempt role slugs.
cev_challenge_unverified_login$challenge (bool), $user_id2.10.0Control whether an unverified customer is challenged at login. Return false to skip the challenge for that user.
cev_should_enforce_login_auth_for_user$enforce (bool), $user_id, $policy, $roles2.10.0Control whether Login Authentication applies to a given user.
cev_disposable_extra_domains$extra (array), default []2.10.0Return an array of extra domains to treat as disposable, in addition to the built-in and admin-defined lists.
cev_disposable_extra_excluded_domains$extra (array), default []2.10.0Return an array of extra domains to always allow, overriding the disposable rule.
cev_email_validation_rules$rules (array of callables), $email, $context2.10.0Each rule is callable(string $email, string $context): true|WP_Error, run in order; the first WP_Error short-circuits the chain. Add, remove, or reorder rules by returning a modified array.
cev_signup_risk$result { score:int, reasons:string[] }, $email, $context3.0.2Adjust the computed sign-up risk score/reasons before it’s used to allow, challenge, or block. Only exists from 3.0.2 — adding this filter on an older version will never fire.
cev_login_risk$result { score:int, reasons:string[] }, $user_id, $login_details (array), $known_profiles (array)3.0.2Adjust the computed login-risk score/reasons. login_details describes the current login attempt; known_profiles holds the user’s previously-seen device/location profiles. Only exists from 3.0.2.
cev_login_risk_failed_threshold$threshold (int), default 33.0.2Number of recent failed login attempts that adds risk score. Undocumented elsewhere.
cev_login_risk_idle_days$days (int), default 603.0.2Number of idle days since last login that adds risk score. Undocumented elsewhere.
cev_pro_email_language_slug$slug, $user_id, $recipient_email2.10.0Change the language used when sending a verification email (WPML/Polylang).
cev_verification_code_length does not change the OTP length
This filter only rewrites the text label shown to the customer (“4-digit code”). The actual number of digits sent and validated is controlled entirely by the OTP Length setting in Settings — changing this filter without also changing that setting will show a label that doesn’t match the real code length.

Smart Form

The Smart Form has its own set of filters, covering custom registration fields, compatibility with stores that add required WooCommerce registration fields, and the redirect applied after login or registration.

Customizing the Smart Form: Custom Fields, Validation and Redirects