array( 'name' => __( 'Contact', 'pubforms' ), 'description' => __( 'Classic contact form: name, email, subject and message.', 'pubforms' ), 'fields' => array( array( 'label' => __( 'Name', 'pubforms' ), 'type' => 'text', 'required' => true ), array( 'label' => __( 'Email', 'pubforms' ), 'type' => 'email', 'required' => true ), array( 'label' => __( 'Subject', 'pubforms' ), 'type' => 'text', 'required' => true ), array( 'label' => __( 'Message', 'pubforms' ), 'type' => 'textarea', 'required' => true ), ), ), 'quote' => array( 'name' => __( 'Request a quote', 'pubforms' ), 'description' => __( 'Capture a quote request with company and project details.', 'pubforms' ), 'fields' => array( array( 'label' => __( 'Name', 'pubforms' ), 'type' => 'text', 'required' => true ), array( 'label' => __( 'Email', 'pubforms' ), 'type' => 'email', 'required' => true ), array( 'label' => __( 'Company', 'pubforms' ), 'type' => 'text' ), array( 'label' => __( 'Phone', 'pubforms' ), 'type' => 'phone' ), array( 'label' => __( 'Budget', 'pubforms' ), 'type' => 'radio', 'options' => array( 'Under €500', '€500 – €2,000', 'Over €2,000' ) ), array( 'label' => __( 'Project details', 'pubforms' ), 'type' => 'textarea', 'required' => true ), ), ), 'newsletter' => array( 'name' => __( 'Newsletter signup', 'pubforms' ), 'description' => __( 'Just an email address and a checkbox to opt in.', 'pubforms' ), 'fields' => array( array( 'label' => __( 'First name', 'pubforms' ), 'type' => 'text', 'width' => 'half' ), array( 'label' => __( 'Email', 'pubforms' ), 'type' => 'email', 'required' => true, 'width' => 'half' ), array( 'label' => __( 'I’d like to subscribe', 'pubforms' ), 'type' => 'checkbox', 'required' => true ), ), ), 'booking' => array( 'name' => __( 'Booking inquiry', 'pubforms' ), 'description' => __( 'Date, time and the number of people for a booking.', 'pubforms' ), 'fields' => array( array( 'label' => __( 'Name', 'pubforms' ), 'type' => 'text', 'required' => true ), array( 'label' => __( 'Email', 'pubforms' ), 'type' => 'email', 'required' => true, 'width' => 'half' ), array( 'label' => __( 'Phone', 'pubforms' ), 'type' => 'phone', 'width' => 'half' ), array( 'label' => __( 'Date', 'pubforms' ), 'type' => 'date', 'required' => true, 'width' => 'half' ), array( 'label' => __( 'Number of people', 'pubforms' ), 'type' => 'number', 'required' => true, 'width' => 'half' ), array( 'label' => __( 'Notes', 'pubforms' ), 'type' => 'textarea' ), ), ), 'feedback' => array( 'name' => __( 'Feedback / support', 'pubforms' ), 'description' => __( 'A support request with a category and priority.', 'pubforms' ), 'fields' => array( array( 'label' => __( 'Name', 'pubforms' ), 'type' => 'text', 'required' => true ), array( 'label' => __( 'Email', 'pubforms' ), 'type' => 'email', 'required' => true ), array( 'label' => __( 'Topic', 'pubforms' ), 'type' => 'select', 'options' => array( __( 'General', 'pubforms' ), __( 'Question', 'pubforms' ), __( 'Problem', 'pubforms' ), __( 'Other', 'pubforms' ) ) ), array( 'label' => __( 'Message', 'pubforms' ), 'type' => 'textarea', 'required' => true ), ), ), 'order' => array( 'name' => __( 'Simple order', 'pubforms' ), 'description' => __( 'A lightweight order form with quantities.', 'pubforms' ), 'fields' => array( array( 'label' => __( 'Name', 'pubforms' ), 'type' => 'text', 'required' => true ), array( 'label' => __( 'Email', 'pubforms' ), 'type' => 'email', 'required' => true ), array( 'label' => __( 'Shipping address', 'pubforms' ), 'type' => 'textarea', 'required' => true ), array( 'label' => __( 'Items', 'pubforms' ), 'type' => 'checkbox_multi', 'options' => array( 'Red', 'Blue', 'Green' ) ), array( 'label' => __( 'Quantity', 'pubforms' ), 'type' => 'number', 'required' => true ), ), ), 'rsvp' => array( 'name' => __( 'Event RSVP', 'pubforms' ), 'description' => __( 'Collect attendance and dietary preferences for an event.', 'pubforms' ), 'fields' => array( array( 'label' => __( 'Name', 'pubforms' ), 'type' => 'text', 'required' => true ), array( 'label' => __( 'Email', 'pubforms' ), 'type' => 'email', 'required' => true ), array( 'label' => __( 'Will you attend?', 'pubforms' ), 'type' => 'radio', 'required' => true, 'options' => array( 'Yes', 'No', 'Maybe' ) ), array( 'label' => __( 'Party size', 'pubforms' ), 'type' => 'number', 'required' => true ), array( 'label' => __( 'Dietary needs', 'pubforms' ), 'type' => 'checkbox_multi', 'options' => array( 'Vegetarian', 'Vegan', 'Gluten-free', 'None' ) ), ), ), 'registration' => array( 'name' => __( 'Event registration', 'pubforms' ), 'description' => __( 'Register attendees with contact and role details.', 'pubforms' ), 'fields' => array( array( 'label' => __( 'Full name', 'pubforms' ), 'type' => 'text', 'required' => true ), array( 'label' => __( 'Email', 'pubforms' ), 'type' => 'email', 'required' => true ), array( 'label' => __( 'Company', 'pubforms' ), 'type' => 'text' ), array( 'label' => __( 'Role', 'pubforms' ), 'type' => 'select', 'options' => array( 'Marketing', 'Sales', 'Engineering', 'Leadership' ) ), ), ), 'application' => array( 'name' => __( 'Job application', 'pubforms' ), 'description' => __( 'Applicant details and availability.', 'pubforms' ), 'fields' => array( array( 'label' => __( 'Name', 'pubforms' ), 'type' => 'text', 'required' => true ), array( 'label' => __( 'Email', 'pubforms' ), 'type' => 'email', 'required' => true ), array( 'label' => __( 'Phone', 'pubforms' ), 'type' => 'phone', 'width' => 'half' ), array( 'label' => __( 'Notice period (weeks)', 'pubforms' ), 'type' => 'number', 'width' => 'half' ), array( 'label' => __( 'Why are you a good fit?', 'pubforms' ), 'type' => 'textarea', 'required' => true ), ), ), 'survey' => array( 'name' => __( 'Satisfaction survey', 'pubforms' ), 'description' => __( 'A short customer satisfaction survey.', 'pubforms' ), 'fields' => array( array( 'label' => __( 'How likely are you to recommend us?', 'pubforms' ), 'type' => 'radio', 'required' => true, 'options' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ) ), array( 'label' => __( 'What could we improve?', 'pubforms' ), 'type' => 'textarea' ), array( 'label' => __( 'Email (optional)', 'pubforms' ), 'type' => 'email' ), ), ), ) ); } /** * A single template by slug, or null. * * @param string $slug * @return array|null */ function pubforms_template( $slug ) { $templates = pubforms_templates(); $slug = sanitize_key( $slug ); return isset( $templates[ $slug ] ) ? $templates[ $slug ] : null; }