Category: Admin
Conditionally disable Cloudflare Turnstile
/** * Conditionally disable Cloudflare Turnstile * * @param array $form_data Form data. * @return array Modified form data. */ function wpf_disable_turnstile( $form_data ) { // Disable CAPTCHA setting. $form_data[‘settings’][‘recaptcha’] = ‘0’; return $form_data; } add_filter( ‘wpforms_frontend_form_data’, ‘wpf_disable_turnstile’, 10, 1…Continue reading
Number slider validation for multi page forms
/** * Prevent moving to next page if Number Slider value is below a threshold. * * Outputs inline JS in the footer for the target form. */ add_action(‘wpforms_wp_footer_end’, function () { // where 1520 is the form ID and…Continue reading
Number slider validation for single page forms
/** * Validate Number Slider on submit and require a non-zero value. * * Runs after the form is submitted and before processing completes. * * @param int $field_id Current field ID being validated. * @param mixed $field_submit Submitted value.…Continue reading
How to Programmatically Attach a File to Email Notifications
add_filter( ‘wpforms_emails_mailer_get_attachments’, function( $attachments, $mailer ) { // Get the uploads directory path. $upload_dir = wp_upload_dir(); // Add your custom file path(s) $file_url = ‘/path/to/your/file.pdf’; // Convert URL to local file path. $file_path = str_replace( $upload_dir[‘baseurl’], $upload_dir[‘basedir’], $file_url ); //…Continue reading
Mapping WPForms Checkbox Values to ACF Checkbox Fields
/** Update ACF age field based on WPForms checkbox submission. @param int $post_id Post ID. @param array $fields Sanitized entry field values/properties. @param array $form_data Form settings/data. @param int $entry_id Entry ID. @return void */ function wpf_dev_update_age_field_from_submission( $post_id, $fields, $form_data,…Continue reading
Logged in User Drop Down Menu
[user_avatar] [display_name] Manage Membership Log OutContinue reading
Create Avatar & User Shortcodes and Display for Logged in Users
// This creates an avater Shortode function bb_logged_in_user_avatar_shortcode($atts) { if (is_user_logged_in()) { $current_user = wp_get_current_user(); $avatar = get_avatar($current_user->ID, 96); // 96 is the size in pixels return $avatar; } else { return ”; } } // This creates an USER…Continue reading
master home page final
Shop Doggyography Blog Contact More than a collar. A nightly transformation. An expression of identity. A statement of love. Your dog deserves to be seen. …And you deserve to walk without worry. The Night Everything Changed Late one night, in…Continue reading
Expose WP User Meta as Shortcodes
function rd__current_user() { static $u = null; if ($u !== null) { return $u; } $u = wp_get_current_user(); // Core: sets current user if not already set. return $u; } /** [user_first_name] */ function rd_sc_user_first_name() { static $first = null;…Continue reading