impress-org / givewp-snippet-library

A collection of code snippets to enhance or expand on the free Give WordPress Donation Plugin.
https://givewp.com
140 stars 90 forks source link

[Incorrect snippet] Multi-step form template (iframe) custom CSS dependency parameter invalid #147

Open frzsombor opened 1 year ago

frzsombor commented 1 year ago

User Story

As a developer, I want to load custom CSS files in Multi-step form templates (in iframe), but ONLY when the loaded page is a form template iframe.

Details

In the enqueue-style-for-givewp-iframes.php example file, the third parameter (dependency) should be an array, to make sure custom CSS is only loaded when the page is a form template. Currently it is a string, which makes the snippet load the provided CSS in every WP page.

Expected Behavior

Load custom CSS files in Multi-step form templates (in iframe) ONLY when the loaded page is a form template iframe.

Steps to Reproduce

  1. Apply modifications in enqueue-style-for-givewp-iframes.php
  2. Check if they are loaded on the form template page
  3. Verify that they are also loaded on every WP page.

Acceptance Criteria