Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automagically enqueue popups when detected during page load. #543

Closed
4 tasks done
danieliser opened this issue Mar 22, 2018 · 11 comments
Closed
4 tasks done

Automagically enqueue popups when detected during page load. #543

danieliser opened this issue Mar 22, 2018 · 11 comments

Comments

@danieliser
Copy link
Member

danieliser commented Mar 22, 2018

  • When rendering nav menu items that link to a specific popup.
  • When a nav menu item has a class of popmake- or pum-
  • When the [popup_trigger] shortcode is used.
  • When the_content contains classes or a shortcode for a particular popup
@danieliser danieliser changed the title Auto enque popups when detected during page load. Automagically enqueue popups when detected during page load. Mar 22, 2018
@danieliser danieliser added this to the v1.8 milestone Mar 23, 2018
@danieliser danieliser modified the milestones: v1.8, v1.9 Dec 24, 2018
@danieliser danieliser modified the milestones: v1.9, v1.10 Jan 14, 2020
@danieliser danieliser modified the milestones: v1.10, v1.11 Jan 29, 2020
@danieliser danieliser mentioned this issue May 8, 2020
11 tasks
@fpcorso fpcorso modified the milestones: v1.11, v1.12 Jun 4, 2020
@fpcorso
Copy link
Contributor

fpcorso commented Jul 10, 2020

@danieliser Is this a duplicate of #96 or would #96 be one more checkbox for this issue?

@danieliser
Copy link
Member Author

@fpcorso I think #96 would be a checkbox here.

@danieliser
Copy link
Member Author

Maybe close that one and move its notes here as a subtask.

@fpcorso fpcorso modified the milestones: v1.12, v1.13 Aug 6, 2020
@fpcorso fpcorso modified the milestones: v1.13, v1.14 Oct 1, 2020
@fpcorso fpcorso modified the milestones: v1.14, v1.15 Oct 21, 2020
@fpcorso
Copy link
Contributor

fpcorso commented Dec 11, 2020

@danieliser Knowing we are removing the old form integration system, do we still need that step of checking for the thank you option? Additionally, should we check for forms on a page that one of the popups has a form submission trigger for?

@danieliser
Copy link
Member Author

@fpcorso Good point, but removing and deprecating are 2 different things. To fully remove it we'd have to do migration routines for all of the orignal form integrations, pulling settings from each form and mapping it over all their popups (maybe).

So we should likely contend that it will still be functioning for some time and would need to catch those as well.

@fpcorso
Copy link
Contributor

fpcorso commented Dec 21, 2020

@danieliser Okay, that sounds good for my first question. Can you answer my second question?

@fpcorso
Copy link
Contributor

fpcorso commented Dec 21, 2020

@danieliser Also, in addition to my previous question: Was reviewing the code and it seems like the PUM_Site_* classes will handle everything as long as I run PUM_Site_Popups::preload_popup( $popup ); when a popup is needed, right?

So, if we have a filter for the content that scans for a PM class, we would just need to call that for the needed popup, right? Or am I missing a piece?

@danieliser
Copy link
Member Author

@fpcorso first question, maybe. We could probably do that as an upgrade later as well.

And yes preload_popup should do the trick, it was the original intent of that method I believe.

@fpcorso
Copy link
Contributor

fpcorso commented Dec 22, 2020

@danieliser For within the_content filter, should we only enqueue when on the individual post's page or should we also load our popup if the content is loaded on an archives page or elsewhere?

I.e., should I add a conditional such as is_singular() && in_the_loop() && is_main_query()?

@fpcorso
Copy link
Contributor

fpcorso commented Dec 22, 2020

@danieliser In addition to previous questions: What about enabled/disabled? Should we only preload when the popup is enabled? I can see it both ways but I think we should go with only loading if enabled.

fpcorso added a commit that referenced this issue Dec 22, 2020
@danieliser
Copy link
Member Author

danieliser commented Dec 22, 2020

@fpcorso

should we only enqueue when on the individual post's page or should we also load our popup if the content is loaded on an archives page or elsewhere?

Ehh, the latter is more feature complete, but it becomes difficult to properly scan all the popups needed early enough that they can include their needed assets.

To clarify, if a popup contains a form for example, and that form needs assets enqueued before wp_head, and we don't scan its shortcode in a popup until that popup gets enqueud in the loop somewhere it might fail to function properly.

enabled/disabled

I think this one is more simple, we gave them an explicit method to disable a popup, we should 100% respect that. So no I wouldn't scan for a disabled popup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants