{"id":42095575,"url":"https://github.com/lexo-ch/lexo-forms","last_synced_at":"2026-01-26T11:18:54.357Z","repository":{"id":327258818,"uuid":"1087105520","full_name":"lexo-ch/lexo-forms","owner":"lexo-ch","description":"Forms management and CleverReach integration","archived":false,"fork":false,"pushed_at":"2026-01-12T10:09:37.000Z","size":530,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-12T18:51:00.956Z","etag":null,"topics":["php8","plugin","releases","updates","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lexo-ch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-31T11:42:15.000Z","updated_at":"2026-01-12T10:09:39.000Z","dependencies_parsed_at":"2026-01-12T13:02:11.712Z","dependency_job_id":null,"html_url":"https://github.com/lexo-ch/lexo-forms","commit_stats":null,"previous_names":["lexo-ch/lexo-forms"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/lexo-ch/lexo-forms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexo-ch%2Flexo-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexo-ch%2Flexo-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexo-ch%2Flexo-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexo-ch%2Flexo-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lexo-ch","download_url":"https://codeload.github.com/lexo-ch/lexo-forms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexo-ch%2Flexo-forms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28777012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T09:42:00.929Z","status":"ssl_error","status_checked_at":"2026-01-26T09:42:00.591Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php8","plugin","releases","updates","wordpress","wordpress-plugin"],"created_at":"2026-01-26T11:18:53.669Z","updated_at":"2026-01-26T11:18:54.351Z","avatar_url":"https://github.com/lexo-ch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LEXO Forms\n\nWordPress plugin for advanced form management with CleverReach integration.\n\n## Versioning\n\nRelease tags are created with Semantic versioning in mind. Commit messages were following convention of [Conventional Commits](https://www.conventionalcommits.org/).\n\n## Compatibility\n- WordPress version `\u003e=6.4`. Tested and works fine up to `6.8.3`.\n- PHP version `\u003e=7.4.1`. Tested and works fine up to `8.4.4`.\n\n## Requirements\n\n- **Advanced Custom Fields PRO** (`advanced-custom-fields-pro`)\n- **LEXO Captcha** (`lexo-captcha`)\n\n## Installation\n\n1. Download the [latest release](https://github.com/lexo-ch/lexo-forms/releases/latest).\n2. Under Assets, click on the link named `Version x.y.z`. It's a compiled build.\n3. Extract zip file and copy the folder into your `wp-content/plugins` folder and activate LEXO Forms in plugins admin page. Alternatively, you can use downloaded zip file to install it directly from your plugin admin page.\n\n## Usage\n\n### Creating a Form\n\n1. Go to **Forms** \u003e **Add New** in WordPress admin.\n2. Configure the form settings:\n   - **General Settings:** Select template, success/fail messages\n   - **Email Settings:** Configure recipients, subject, sender\n   - **CleverReach Integration:** Select group, form type, double opt-in settings\n3. Publish the form.\n\n### Inserting Forms\n\n#### Shortcode\n\n```php\n[lexo_form id=\"123\"]\n```\n\n#### TinyMCE Button\n\nUse the \"Forms\" button in the WordPress editor toolbar to visually select and insert a form.\n\n#### PHP\n\n```php\necho do_shortcode('[lexo_form id=\"123\"]');\n```\n\n### Form Templates\n\nForms are built using PHP templates located in `template-forms/`.\nCustom templates can also be registered by creating a `template-forms/` directory in your active theme and placing template files inside it. The plugin automatically loads templates from both locations.\n\n### Form Preview Images\n\nEach form template can have a preview image displayed in the admin template selector. Preview images help users visually identify templates.\n\n#### How It Works\n\n1. Place preview images in `template-forms/previews/` directory\n2. Name the image file the same as the template (e.g., `contact.svg` for `contact.php`)\n3. The plugin automatically detects and displays the preview\n\n#### Supported Formats\n\nImages are searched in this priority order:\n- `.webp` (recommended for best compression)\n- `.png`\n- `.jpg` / `.jpeg`\n- `.svg` (recommended for scalable graphics)\n\n#### Directory Structure\n\n```\ntemplate-forms/\n├── contact.php\n├── newsletter.php\n└── previews/\n    ├── contact.svg\n    └── newsletter.svg\n```\n\n#### Theme Override\n\nTheme templates can also have previews:\n\n```\nyour-theme/\n└── template-forms/\n    ├── custom-form.php\n    └── previews/\n        └── custom-form.webp\n```\n\n#### Lightbox Feature\n\nClicking on a preview image opens a lightbox for a larger view. This is handled automatically by the admin JavaScript (`LexoFormsLightbox` module).\n\nTo disable zoom for specific previews, add the `lexoforms-preview-wrap--no-zoom` CSS class.\n\n#### Contact Form Template\n\n```php\n\u003c?php\n// template-forms/contact.php\n$name = __('Contact Form', 'lf');\n$fields = [\n    [\n        'name' =\u003e 'firstname',\n        'type' =\u003e 'text',\n        'label' =\u003e ['de' =\u003e 'Name', 'en' =\u003e 'Name'],\n        'required' =\u003e true,\n        'send_to_cr' =\u003e true\n    ],\n    // ... more fields\n];\n```\n\n#### Available Template Fields\n\n- `name` — Internal field name\n- `type` — Field type (`text`, `email`, `textarea`, `file`, `tel`, `checkbox`)\n- `html_type` — HTML element (`input`, `textarea`, `select`)\n- `label` — Multi-language labels (array with language codes)\n- `placeholder` — Multi-language placeholders\n- `required` — Required field flag (boolean)\n- `email_label` — Label for email notifications\n- `cr_description` — CleverReach field description\n- `global` — CleverReach global attribute flag\n- `send_to_cr` — Send to CleverReach flag\n\n#### Form Handler Types\n\n- **Email Only** — Send only email notifications.\n- **CleverReach Only** — Send only to CleverReach.\n- **Email \u0026 CleverReach** — Send to both (recommended).\n\n### Visitor Email Variants\n\nVisitor Email Variants allow different confirmation emails based on user selection in the form (e.g., different emails for \"Sales inquiry\" vs \"Support request\").\n\n#### How It Works\n\n1. Template defines a `controlling_field` (e.g., a select/radio field)\n2. Template defines `variants` with keys matching the field options\n3. Admin configures subject, content, and attachment for each variant\n4. On submission, the system sends the email matching the user's selection\n\n#### Template Configuration\n\nAdd `visitor_email_variants` to your template's return array:\n\n```php\n// template-forms/inquiry.php\nreturn [\n    'name' =\u003e $name,\n    'fields' =\u003e $fields,\n    'html' =\u003e $html,\n    'visitor_email_variants' =\u003e [\n        'controlling_field' =\u003e 'inquiry_type', // Field name that controls variant\n        'variants' =\u003e [\n            'sales' =\u003e [\n                'label' =\u003e 'Sales Inquiry',  // Label shown in admin\n            ],\n            'support' =\u003e [\n                'label' =\u003e 'Support Request',\n            ],\n            'partnership' =\u003e [\n                'label' =\u003e 'Partnership',\n            ],\n        ],\n    ],\n];\n```\n\n#### Form Field Example\n\nThe controlling field must be defined in `$fields`:\n\n```php\n$fields = [\n    [\n        'name' =\u003e 'inquiry_type',\n        'type' =\u003e 'text',\n        'html_type' =\u003e 'select',\n        'label' =\u003e ['de' =\u003e 'Anfragetyp', 'en' =\u003e 'Inquiry Type'],\n        'options' =\u003e [\n            'sales' =\u003e ['de' =\u003e 'Verkauf', 'en' =\u003e 'Sales'],\n            'support' =\u003e ['de' =\u003e 'Support', 'en' =\u003e 'Support'],\n            'partnership' =\u003e ['de' =\u003e 'Partnerschaft', 'en' =\u003e 'Partnership'],\n        ],\n        'required' =\u003e true,\n        'email_label' =\u003e ['de' =\u003e 'Typ', 'en' =\u003e 'Type'],\n    ],\n    // ... other fields\n];\n```\n\n#### Admin Configuration\n\nWhen a template with variants is selected:\n\n1. The \"Visitor Email Variants\" section appears in Email Settings\n2. Each variant has its own tab with:\n   - Subject field\n   - Content (WYSIWYG editor)\n   - Attachment (optional file)\n\n#### Behavior\n\n- If template has variants → standard visitor email fields are hidden\n- Variant selection is automatic based on form submission data\n- If no matching variant found → no visitor email sent\n- Each variant can have completely different content and attachments\n\n### Email Configuration\n\n#### Admin Notification Emails\n\nConfigure in the form's **Email Settings** section:\n\n- **Recipients** — Multiple email addresses (repeater field)\n- **Subject** — Email subject line\n- **Sender Email** — From email address\n- **Sender Name** — From name\n\n#### Confirmation Emails\n\nEnable in **Email Settings** \u003e **Enable Additional Email**:\n\n- **Subject** — Confirmation email subject\n- **Body** — HTML email body with placeholder support\n- **Sender Email** — From email address\n- **Sender Name** — From name\n- **Attachment** — PDF or other file attachment\n\n## Filters\n\n### CleverReach Email Filters\n\n#### `lexo-forms/cr/email/config`\n\nFilter email configuration for form submissions.\n\n```php\napply_filters('lexo-forms/cr/email/config', array $config, int $form_id, array $form_data);\n```\n\n**Parameters**\n\n- `$config` (array) — Email configuration\n  - `recipients` (array) — Email recipients\n  - `subject` (string) — Email subject\n  - `from_email` (string) — Sender email\n  - `from_name` (string) — Sender name\n  - `reply_to_email` (string) — Reply-to email\n  - `reply_to_name` (string) — Reply-to name\n- `$form_id` (int) — Form post ID\n- `$form_data` (array) — Submitted form data\n\n**Example**\n\n```php\nadd_filter('lexo-forms/cr/email/config', function($config, $form_id, $form_data) {\n    if ($form_id === 123) {\n        $config['recipients'] = ['admin@example.com'];\n        $config['subject'] = 'New Contact Form Submission';\n    }\n    return $config;\n}, 10, 3);\n```\n\n---\n\n#### `lexo-forms/cr/email/confirmation/subject`\n\nFilter confirmation email subject.\n\n```php\napply_filters('lexo-forms/cr/email/confirmation/subject', string $subject, int $form_id);\n```\n\n**Default:** Value from `FormMessages::getConfirmationEmailSubject()`\n\n**Example**\n\n```php\nadd_filter('lexo-forms/cr/email/confirmation/subject', function($subject, $form_id) {\n    return 'Thank you for contacting us!';\n}, 10, 2);\n```\n\n---\n\n#### `lexo-forms/cr/email/confirmation/sender`\n\nFilter confirmation email sender address.\n\n```php\napply_filters('lexo-forms/cr/email/confirmation/sender', string $sender_email, int $form_id);\n```\n\n**Default:** `EMAIL_FROM_EMAIL` constant\n\n---\n\n#### `lexo-forms/cr/email/confirmation/sender-name`\n\nFilter confirmation email sender name.\n\n```php\napply_filters('lexo-forms/cr/email/confirmation/sender-name', string $sender_name, int $form_id);\n```\n\n**Default:** `EMAIL_FROM_NAME` constant\n\n---\n\n#### `lexo-forms/cr/email/confirmation/body`\n\nFilter confirmation email body content.\n\n```php\napply_filters('lexo-forms/cr/email/confirmation/body', string $body, int $form_id);\n```\n\n**Default:** Empty string\n\n---\n\n#### `lexo-forms/cr/email/admin-notification/label-language`\n\nFilter language for field labels in admin notification emails.\n\n```php\napply_filters('lexo-forms/cr/email/admin-notification/label-language', string $language);\n```\n\n**Default:** `'de'`\n\n**Example**\n\n```php\nadd_filter('lexo-forms/cr/email/admin-notification/label-language', function($language) {\n    return 'en'; // Use English labels\n});\n```\n\n---\n\n#### `lexo-forms/cr/email/admin-notification/field-label`\n\nFilter individual field label in admin notification emails.\n\n```php\napply_filters('lexo-forms/cr/email/admin-notification/field-label', string $label, string $field_name, array $field_config);\n```\n\n**Parameters**\n\n- `$label` (string) — Field label\n- `$field_name` (string) — Field name\n- `$field_config` (array) — Complete field configuration\n\n**Example**\n\n```php\nadd_filter('lexo-forms/cr/email/admin-notification/field-label', function($label, $field_name, $field_config) {\n    if ($field_name === 'email') {\n        return 'Customer Email';\n    }\n    return $label;\n}, 10, 3);\n```\n\n---\n\n### Forms Filters\n\n#### `lexo-forms/forms/grid/columns`\n\nFilter number of grid columns for form layout.\n\n```php\napply_filters('lexo-forms/forms/grid/columns', int $columns, string $form_type);\n```\n\n**Parameters**\n\n- `$columns` (int) — Number of columns (default: 2 for contact, 1 for newsletter)\n- `$form_type` (string) — Form type identifier (`contact`, `newsletter`)\n\n**Example**\n\n```php\nadd_filter('lexo-forms/forms/grid/columns', function($columns, $form_type) {\n    if ($form_type === 'contact') {\n        return 3; // Use 3 columns for contact forms\n    }\n    return $columns;\n}, 10, 2);\n```\n\n---\n\n#### `lexo-forms/forms/grid/classes`\n\nFilter CSS classes for form grid wrapper.\n\n```php\napply_filters('lexo-forms/forms/grid/classes', string $classes, string $form_type, int $grid_columns);\n```\n\n**Parameters**\n\n- `$classes` (string) — Default CSS classes\n- `$form_type` (string) — Form type identifier\n- `$grid_columns` (int) — Number of columns\n\n**Example**\n\n```php\nadd_filter('lexo-forms/forms/grid/classes', function($classes, $form_type, $grid_columns) {\n    return $classes . ' custom-form-styling';\n}, 10, 3);\n```\n\n---\n\n#### `lexo-forms/forms/toolbar/additional`\n\nFilter additional ACF WYSIWYG toolbars where forms button appears.\n\n```php\napply_filters('lexo-forms/forms/toolbar/additional', array $toolbars);\n```\n\n**Default:** `[]` (only \"Full\" and \"Full FC\" by default)\n\n**Example**\n\n```php\nadd_filter('lexo-forms/forms/toolbar/additional', function($toolbars) {\n    $toolbars[] = 'Basic';\n    $toolbars[] = 'Custom';\n    return $toolbars;\n});\n```\n\n---\n\n#### `lexo-forms/forms/toolbar/email/buttons`\n\nFilter buttons in additional email WYSIWYG toolbar.\n\n```php\napply_filters('lexo-forms/forms/toolbar/email/buttons', array $toolbar);\n```\n\n**Parameters**\n\n- `$toolbar` (array) — Toolbar configuration with rows\n\n**Default Buttons (Row 1)**\n\n- `formatselect`, `bold`, `italic`, `underline`, `bullist`, `numlist`, `link`, `unlink`, `alignleft`, `aligncenter`, `alignright`, `removeformat`, `pastetext`, `undo`, `redo`\n\n**Example**\n\n```php\nadd_filter('lexo-forms/forms/toolbar/email/buttons', function($toolbar) {\n    // Add strikethrough to row 1\n    $toolbar[1][] = 'strikethrough';\n\n    // Add color buttons to row 2\n    $toolbar[2] = ['forecolor', 'backcolor'];\n\n    return $toolbar;\n});\n```\n\n---\n\n#### `lexo-forms/forms/email/label-language`\n\nFilter language for email labels in form submission emails.\n\n```php\napply_filters('lexo-forms/forms/email/label-language', string $language);\n```\n\n**Default:** `'de'`\n\n**Example**\n\n```php\nadd_filter('lexo-forms/forms/email/label-language', function($language) {\n    return 'en';\n});\n```\n\n---\n\n### Contact Form Privacy Filters\n\nThese filters allow customization of the privacy notice displayed in the contact form template.\n\n#### `lexo-forms/forms/contact/privacy_url`\n\nFilter the privacy policy page URL.\n\n```php\napply_filters('lexo-forms/forms/contact/privacy_url', string $url);\n```\n\n**Default:** `''` (empty, privacy notice hidden when empty)\n\n**Example**\n\n```php\nadd_filter('lexo-forms/forms/contact/privacy_url', function($url) {\n    return get_privacy_policy_url(); // WordPress privacy page\n});\n\n// Or custom URL\nadd_filter('lexo-forms/forms/contact/privacy_url', function($url) {\n    return 'https://example.com/datenschutz';\n});\n```\n\n---\n\n#### `lexo-forms/forms/contact/privacy_text`\n\nFilter the privacy link text (multilingual array).\n\n```php\napply_filters('lexo-forms/forms/contact/privacy_text', array $text);\n```\n\n**Default:**\n\n```php\n[\n    'de' =\u003e 'Datenschutz',\n    'en' =\u003e 'Privacy Policy',\n    'fr' =\u003e 'Politique de confidentialité',\n    'it' =\u003e 'Informativa sulla privacy'\n]\n```\n\n**Example**\n\n```php\nadd_filter('lexo-forms/forms/contact/privacy_text', function($text) {\n    $text['de'] = 'Datenschutzerklärung';\n    $text['en'] = 'Data Protection';\n    return $text;\n});\n```\n\n---\n\n#### `lexo-forms/forms/contact/privacy_message`\n\nFilter the message displayed after the privacy link.\n\n```php\napply_filters('lexo-forms/forms/contact/privacy_message', array $message);\n```\n\n**Default:**\n\n```php\n[\n    'de' =\u003e ' ist uns wichtig.',\n    'en' =\u003e ' is important to us.',\n    'fr' =\u003e ' est importante pour nous.',\n    'it' =\u003e ' è importante per noi.'\n]\n```\n\n**Example**\n\n```php\nadd_filter('lexo-forms/forms/contact/privacy_message', function($message) {\n    return [\n        'de' =\u003e ' - Ihre Daten sind bei uns sicher.',\n        'en' =\u003e ' - Your data is safe with us.',\n    ];\n});\n```\n\n**Complete Example**\n\n```php\n// Enable privacy notice with all customizations\nadd_filter('lexo-forms/forms/contact/privacy_url', function() {\n    return get_privacy_policy_url();\n});\n\nadd_filter('lexo-forms/forms/contact/privacy_text', function() {\n    return ['de' =\u003e 'Datenschutz', 'en' =\u003e 'Privacy'];\n});\n\nadd_filter('lexo-forms/forms/contact/privacy_message', function() {\n    return ['de' =\u003e ' ist uns wichtig.', 'en' =\u003e ' matters to us.'];\n});\n```\n\nThis renders as: `[Privacy](url) matters to us.`\n\n---\n\n### Forms Messages \u0026 Errors Filters\n\n#### `lexo-forms/forms/messages/success`\n\nFilter the default success message shown after successful form submission.\n\n```php\napply_filters('lexo-forms/forms/messages/success', string $message);\n```\n\n**Default:** `'Your message has been sent successfully. Thank you!'`\n\n**Example**\n\n```php\nadd_filter('lexo-forms/forms/messages/success', function($message) {\n    return 'Thank you! We will get back to you soon.';\n});\n```\n\n---\n\n#### `lexo-forms/forms/messages/email-fail`\n\nFilter the message shown when email sending fails.\n\n```php\napply_filters('lexo-forms/forms/messages/email-fail', string $message);\n```\n\n**Default:** `'Failed to send email'`\n\n---\n\n#### `lexo-forms/forms/messages/captcha-fail`\n\nFilter the message shown when captcha validation fails.\n\n```php\napply_filters('lexo-forms/forms/messages/captcha-fail', string $message);\n```\n\n**Default:** `'Captcha validation failed. Please try again.'`\n\n---\n\n#### `lexo-forms/forms/messages/invalid-email`\n\nFilter the message shown when email field contains invalid format.\n\n```php\napply_filters('lexo-forms/forms/messages/invalid-email', string $message, string $field_label);\n```\n\n**Parameters**\n\n- `$message` (string) — Error message\n- `$field_label` (string) — Label of the email field\n\n**Default:** `'Invalid email format in field: {field_label}'`\n\n---\n\n#### `lexo-forms/forms/messages/confirmation-email-subject`\n\nFilter the default subject for confirmation emails sent to visitors.\n\n```php\napply_filters('lexo-forms/forms/messages/confirmation-email-subject', string $subject);\n```\n\n**Default:** `'Thank you for your message'`\n\n---\n\n#### `lexo-forms/forms/errors/form-id-required`\n\nFilter the error message when form ID is missing.\n\n```php\napply_filters('lexo-forms/forms/errors/form-id-required', string $message);\n```\n\n**Default:** `'Error: Form ID is required.'`\n\n---\n\n#### `lexo-forms/forms/errors/form-not-found`\n\nFilter the error message when form is not found.\n\n```php\napply_filters('lexo-forms/forms/errors/form-not-found', string $message);\n```\n\n**Default:** `'Error: Form not found.'`\n\n---\n\n#### `lexo-forms/forms/errors/template-not-configured`\n\nFilter the error message when form template is not configured.\n\n```php\napply_filters('lexo-forms/forms/errors/template-not-configured', string $message);\n```\n\n**Default:** `'Error: Form template not configured.'`\n\n---\n\n#### `lexo-forms/forms/errors/template-not-found`\n\nFilter the error message when template file is not found.\n\n```php\napply_filters('lexo-forms/forms/errors/template-not-found', string $message);\n```\n\n**Default:** `'Error: Template not found.'`\n\n---\n\n#### `lexo-forms/forms/errors/no-fields-configured`\n\nFilter the error message when no fields are configured in template.\n\n```php\napply_filters('lexo-forms/forms/errors/no-fields-configured', string $message);\n```\n\n**Default:** `'No fields configured for this form'`\n\n---\n\n#### `lexo-forms/forms/errors/required-fields-missing`\n\nFilter the error message when required fields are missing.\n\n```php\napply_filters('lexo-forms/forms/errors/required-fields-missing', string $message, string $field_list);\n```\n\n**Parameters**\n\n- `$message` (string) — Error message\n- `$field_list` (string) — Comma-separated list of missing field names\n\n**Default:** `'Required fields are missing: {field_list}'`\n\n---\n\n### CleverReach Messages \u0026 Errors Filters\n\n#### `lexo-forms/cr/messages/error`\n\nFilter the message shown when CleverReach submission fails.\n\n```php\napply_filters('lexo-forms/cr/messages/error', string $message);\n```\n\n**Default:** `'We encountered an issue submitting your information. Our team has been notified and will contact you shortly.'`\n\n**Example**\n\n```php\nadd_filter('lexo-forms/cr/messages/error', function($message) {\n    return 'Submission failed. Please try again later.';\n});\n```\n\n---\n\n#### `lexo-forms/cr/messages/already-subscribed`\n\nFilter the message shown when email is already subscribed.\n\n```php\napply_filters('lexo-forms/cr/messages/already-subscribed', string $message);\n```\n\n**Default:** `'This email address is already subscribed.'`\n\n---\n\n#### `lexo-forms/cr/errors/form-creation-failed`\n\nFilter the error message when CleverReach form creation fails.\n\n```php\napply_filters('lexo-forms/cr/errors/form-creation-failed', string $message);\n```\n\n**Default:** `'Failed to determine or create form'`\n\n---\n\n#### `lexo-forms/cr/errors/group-id-failed`\n\nFilter the error message when retrieving CleverReach group ID fails.\n\n```php\napply_filters('lexo-forms/cr/errors/group-id-failed', string $message);\n```\n\n**Default:** `'Failed to get group ID from form'`\n\n---\n\n### Core Filters\n\n#### `lexoforms/load_styles`\n\nFilter whether to load plugin styles.\n\n```php\napply_filters('lexoforms/load_styles', bool $load);\n```\n\n**Default:** `true`\n\n**Example**\n\n```php\nadd_filter('lexoforms/load_styles', function($load) {\n    // Don't load on specific pages\n    if (is_page('custom-page')) {\n        return false;\n    }\n    return $load;\n});\n```\n\n---\n\n#### `lexoforms/enqueue/{basename}`\n\nFilter whether to enqueue specific stylesheet.\n\n```php\napply_filters('lexoforms/enqueue/{basename}', bool $enqueue);\n```\n\n**Example**\n\n```php\n// Don't load admin-lf.css on dashboard\nadd_filter('lexoforms/enqueue/admin-lf.css', function($enqueue) {\n    if (is_admin() \u0026\u0026 get_current_screen()-\u003eid === 'dashboard') {\n        return false;\n    }\n    return $enqueue;\n});\n```\n\n---\n\n#### `lexoforms/load_scripts`\n\nFilter whether to load plugin scripts.\n\n```php\napply_filters('lexoforms/load_scripts', bool $load);\n```\n\n**Default:** `true`\n\n---\n\n#### `lexoforms/enqueue/{basename}`\n\nFilter whether to enqueue specific script.\n\n```php\napply_filters('lexoforms/enqueue/{basename}', bool $enqueue);\n```\n\n**Example**\n\n```php\n// Don't load admin-lf.js on specific pages\nadd_filter('lexoforms/enqueue/admin-lf.js', function($enqueue) {\n    if (is_admin() \u0026\u0026 get_current_screen()-\u003eid === 'plugins') {\n        return false;\n    }\n    return $enqueue;\n});\n```\n\n---\n\n#### `lexoforms/load_editor_styles`\n\nFilter whether to load editor styles.\n\n```php\napply_filters('lexoforms/load_editor_styles', bool $load);\n```\n\n**Default:** `true`\n\n---\n\n#### `lexoforms/add_editor_style/{basename}`\n\nFilter whether to add specific editor style.\n\n```php\napply_filters('lexoforms/add_editor_style/{basename}', bool $add);\n```\n\n**Default:** `true`\n\n---\n\n#### `lexo-forms/plugin_sections`\n\nFilter plugin update information sections.\n\n```php\napply_filters('lexo-forms/plugin_sections', array $sections);\n```\n\n**Parameters**\n\n- `$sections` (array) — Array with `description` and `changelog` keys\n\n---\n\n#### `lexoforms/admin_localized_script`\n\nFilter admin localized script variables.\n\n```php\napply_filters('lexoforms/admin_localized_script', array $vars);\n```\n\n**Parameters**\n\n- `$vars` (array) — Array of variables passed to `wp_localize_script`\n  - `ajaxurl` (string) — WordPress AJAX URL\n  - `nonce` (string) — Nonce for AJAX requests\n  - `plugin_name` (string) — Plugin name\n  - `plugin_slug` (string) — Plugin slug\n  - `plugin_version` (string) — Plugin version\n  - `min_php_version` (string) — Minimum PHP version\n  - `min_wp_version` (string) — Minimum WordPress version\n  - `text_domain` (string) — Text domain\n\n**Example**\n\n```php\nadd_filter('lexoforms/admin_localized_script', function($vars) {\n    $vars['custom_data'] = 'My custom value';\n    return $vars;\n});\n```\n\n---\n\n#### `lexoforms/options-page/parent-slug`\n\nFilter the parent slug for the settings page in admin menu.\n\n```php\napply_filters('lexoforms/options-page/parent-slug', string $slug);\n```\n\n**Default:** `'options-general.php'`\n\n**Example**\n\n```php\nadd_filter('lexoforms/options-page/parent-slug', function($slug) {\n    return 'admin.php'; // Move to main admin menu\n});\n```\n\n---\n\n#### `lexoforms/options-page/capability`\n\nFilter the capability required to access plugin settings.\n\n```php\napply_filters('lexoforms/options-page/capability', string $capability);\n```\n\n**Default:** `'manage_options'`\n\n**Example**\n\n```php\nadd_filter('lexoforms/options-page/capability', function($capability) {\n    return 'edit_posts'; // Allow editors and above\n});\n```\n\n---\n\n## Actions\n\n### `lexoforms/init`\n\nFires during plugin initialization.\n\n```php\ndo_action('lexoforms/init');\n```\n\n**Usage**\n\n```php\nadd_action('lexoforms/init', function() {\n    // Custom initialization code\n});\n```\n\n---\n\n### `lexoforms/localize/{script-basename}`\n\nFires when localizing scripts for specific script file.\n\n```php\ndo_action('lexoforms/localize/{script-basename}');\n```\n\n**Example**\n\n```php\nadd_action('lexoforms/localize/admin-lf.js', function() {\n    wp_localize_script('lexoforms/admin-lf.js', 'customData', [\n        'ajaxUrl' =\u003e admin_url('admin-ajax.php'),\n        'nonce' =\u003e wp_create_nonce('custom_nonce'),\n    ]);\n});\n```\n\n---\n\n### `lexo-forms/cr/after-submission`\n\nFires after successful CleverReach form submission.\n\n```php\ndo_action('lexo-forms/cr/after-submission', int $form_id, array $form_data, array $template);\n```\n\n**Parameters**\n\n- `$form_id` (int) — Form post ID\n- `$form_data` (array) — Submitted and sanitized form data\n- `$template` (array) — Form template configuration\n\n**Example**\n\n```php\nadd_action('lexo-forms/cr/after-submission', function($form_id, $form_data, $template) {\n    // Log submission to custom analytics\n    error_log('Form submitted: ' . $form_id);\n\n    // Send to additional service\n    send_to_crm($form_data);\n}, 10, 3);\n```\n\n---\n\n### `lexo-forms/core/log`\n\nFires when plugin logs a message.\n\n```php\ndo_action('lexo-forms/core/log', string $level, string $category, string $message, array $context);\n```\n\n**Parameters**\n\n- `$level` (string) — Log level (`debug`, `info`, `warning`, `error`)\n- `$category` (string) — Log category\n- `$message` (string) — Log message\n- `$context` (array) — Additional context data\n\n**Example**\n\n```php\nadd_action('lexo-forms/core/log', function($level, $category, $message, $context) {\n    if ($level === 'error') {\n        // Send error notification\n        mail('admin@example.com', 'Plugin Error', $message);\n    }\n}, 10, 4);\n```\n\n---\n\n## Changelog\n\nFor detailed changelog, see [Releases](https://github.com/lexo-ch/lexo-forms/releases).\n\n---\n\n## Author\n\n- **LEXO GmbH**\n  - Website: [https://www.lexo.ch](https://www.lexo.ch)\n  - GitHub: [https://github.com/lexo-ch](https://github.com/lexo-ch)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexo-ch%2Flexo-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flexo-ch%2Flexo-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexo-ch%2Flexo-forms/lists"}