diff --git a/.github/ISSUE_TEMPLATE/01-ISSUE.md b/.github/ISSUE_TEMPLATE/01-ISSUE.md new file mode 100644 index 0000000..1921f87 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01-ISSUE.md @@ -0,0 +1,48 @@ +--- +name: Issue Report +about: Use this template to report a problem +title: "[VERSION] [PROBLEM SUMMARY]" +labels: bug +assignees: +--- + +## Expected Behavior + +Please describe the behavior you are expecting + +## Current Behavior + +What is the current behavior? + +## Context + +Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. + +* Project Version: +* Operating System: +* Toolchain: +* Toolchain version: + +## Failure Information (for bugs) + +Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template. + +### Steps to Reproduce + +Please provide detailed steps for reproducing the issue. + +1. step 1 +2. step 2 +3. you get it... + +### Failure Logs + +Please include any relevant log snippets or files here. + +## Checklist + +- [ ] I am running the latest version +- [ ] I checked the documentation and found no answer +- [ ] I checked to make sure that this issue has not already been filed +- [ ] I'm reporting the issue to the correct repository (for multi-repository projects) +- [ ] I have provided sufficient information for the team \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/02-FEATURE.md b/.github/ISSUE_TEMPLATE/02-FEATURE.md new file mode 100644 index 0000000..bb1f317 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02-FEATURE.md @@ -0,0 +1,27 @@ +--- +name: Feature Request +about: Use this template for requesting new features +title: "[FEATURE NAME]" +labels: enhancement +assignees: +--- + +## Expected Behavior + +Please describe the behavior you are expecting + +## Current Behavior + +What is the current behavior? + +## Sample Code + +If applicable, provide a sample code snippet that demonstrates the gist of feature you're proposing. This can be either from a usage standpoint, or an implementation standpoint. + +## Context + +Please provide any relevant information about your setup, which will help us ensure the requested support will work for you. + +* Project Version: +* Operating System: +* Toolchain version: \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/03-QUESTION.md b/.github/ISSUE_TEMPLATE/03-QUESTION.md new file mode 100644 index 0000000..f0e4c86 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03-QUESTION.md @@ -0,0 +1,16 @@ +--- +name: Question +about: Use this template to ask a question about the project +title: "[QUESTION SUMMARY]" +labels: ["help wanted", "question"] +assignees: +--- + +## Question + +State your question + +## Sample Code +```php +Please include relevant code snippets or files that provide context for your question. +``` \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..f5e2039 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: GitHub Discussions + url: https://github.com/kulturwunsch/Kultur-API-for-WP/discussions + about: Please ask and answer questions here. + - name: Report a security issue + url: https://kulturwunsch.de/kontakt/ + about: Please report security vulnerabilities here. \ No newline at end of file diff --git a/admin/partials/ka4wp-form-options.php b/admin/partials/ka4wp-form-options.php index fb749bc..63cb08e 100644 --- a/admin/partials/ka4wp-form-options.php +++ b/admin/partials/ka4wp-form-options.php @@ -12,6 +12,11 @@ * @package KA4WP * @subpackage KA4WP/admin/partials */ + + if(!is_plugin_active('contact-form-7/wp-contact-form-7.php') && (is_multisite() && !is_plugin_active_for_network('contact-form-7/wp-contact-form-7.php'))) + { + wp_die(esc_html_e('You have to install the Contact Form 7 plugin before you can configure this form.','kultur-api-for-wp'), esc_html_e('Contact Form 7 plugin is required','kultur-api-for-wp')); + } $form_id = !empty($_GET['post']) ? sanitize_text_field($_GET['post']) : null; $ContactForm = WPCF7_ContactForm::get_instance( $form_id ); @@ -19,7 +24,7 @@ { $props = $ContactForm->get_properties(); - $wpcf7_api_data = $props['ka4wp_api_integrations'] ?? []; + $wpcf7_api_data = $props['ka4wp_api_integrations'] ?: []; $form_fields = $ContactForm->scan_form_tags(); foreach($form_fields as $form_fields_value){ @@ -27,8 +32,11 @@ $ka4wp_field_array[$form_fields_value->raw_name] = $wpcf7_api_data['mapping-'.$form_fields_value->raw_name] ?? ''; } } + + $defaultsOptions = KA4WP_Admin::ka4wp_get_endpoint_defaults($wpcf7_api_data["apiendpoint"] ?? []); + $defaultMappings = $defaultsOptions[$wpcf7_api_data["predefined-mapping"]]['options'] ?? []; } - + //load API types $ApiEndpointPosts = get_posts([ 'post_type' => 'ka4wp', @@ -36,9 +44,6 @@ 'numberposts' => -1, 'order' => 'ASC' ]); - - $defaultsOptions = KA4WP_Admin::ka4wp_get_endpoint_defaults($wpcf7_api_data["apiendpoint"]); - $defaultMappings = $defaultsOptions[$wpcf7_api_data["predefined-mapping"]]['options'] ?? []; ?>

@@ -55,7 +60,7 @@

@@ -75,19 +80,23 @@
- -

+ + +

+
@@ -123,7 +132,7 @@
$ka4wp_form_field_value){ ?>
@@ -147,14 +156,14 @@
$ka4wp_form_field_value){ ?>