[ 'name' => 'Leads', 'singular_name' => 'Lead', ], 'public' => false, 'show_ui' => true, 'menu_icon' => 'dashicons-groups', 'supports' => ['title', 'editor', 'custom-fields'], ]); } add_action('init', 'fl_register_lead_cpt'); function fl_lead_form_shortcode() { if (!empty($_POST['fl_lead_nonce']) && wp_verify_nonce($_POST['fl_lead_nonce'], 'fl_lead_submit')) { $name = sanitize_text_field($_POST['fl_name'] ?? ''); $email = sanitize_email($_POST['fl_email'] ?? ''); $role = sanitize_text_field($_POST['fl_role'] ?? ''); $focus = sanitize_textarea_field($_POST['fl_focus'] ?? ''); $q1 = sanitize_textarea_field($_POST['fl_q1'] ?? ''); $q2 = sanitize_textarea_field($_POST['fl_q2'] ?? ''); $q3 = sanitize_textarea_field($_POST['fl_q3'] ?? ''); $q4 = sanitize_textarea_field($_POST['fl_q4'] ?? ''); $q5 = sanitize_textarea_field($_POST['fl_q5'] ?? ''); $agreement = isset($_POST['fl_agreement']) ? 'Agreed' : 'Not Agreed'; if ($name && $email) { $lead_id = wp_insert_post([ 'post_type' => 'fl_lead', 'post_status' => 'publish', 'post_title' => $name . ' — ' . $email, 'post_content' => "Role/Context: $role\n\nFocus: $focus\n\n1. Tell me about yourself: $q1\n\n2. Signature strengths (friends): $q2\n\n3. Signature strengths (yourself): $q3\n\n4. Zone of genius (lose track of time): $q4\n\n5. Time you transformed yourself: $q5\n\nCoaching Agreement: $agreement", ]); if ($lead_id) { return '
Thank you — your request was received. I will reply within 1–2 business days.
'; } } return '
Please complete required fields and try again.
'; } ob_start(); ?>










.fl-lead-form input, .fl-lead-form textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #cbd5e1; } .fl-lead-form button { background:#0f172a; color:#fff; padding:12px 18px; border-radius:999px; border:none; } .fl-success { padding:12px 16px; background:#dcfce7; border:1px solid #86efac; border-radius:10px; } .fl-error { padding:12px 16px; background:#fee2e2; border:1px solid #fca5a5; border-radius:10px; } '; } add_action('wp_head', 'fl_lead_form_styles');