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

Modal does not find subpages #15

Open
plazareff opened this issue Jul 13, 2020 · 3 comments · May be fixed by #23
Open

Modal does not find subpages #15

plazareff opened this issue Jul 13, 2020 · 3 comments · May be fixed by #23

Comments

@plazareff
Copy link

When the "modal-link" link is of type '/parent-page/subpage", the plugin does not find the page (404) as it calls the get_page_by_pathWP function but only passes the permalink (subpage) where it should pass the whole path (parentpage/subpage)

@plazareff
Copy link
Author

As a temporary workaround, I modified the file wp-post-modal-public.js:

line 229, replaced basename(postLink) by $this[0].pathname

@mikedoubintchik
Copy link
Owner

What do you think the best way to determine if something is a subpage? Another attribute on the a tag?

There's no way to do it automatically that I can think of.

@plazareff
Copy link
Author

I'm not especially at ease with Wordpress development, so I can't tell if there's another WP function that would be more useful than get_page_by_path.

On the JS side, I think I would analyze the href attribute to see if it's a full or relative url, compare the domain name with the current page and act accordingly. My basic opinion being that basename() should be avoided.

I'll look deeper into it when I get some time, closer to the release of the site I'm currently on as I don't like the idea to leave the client with a "hacked" plugin for upgrade's sake anyway...

Thank You for your message ;-)

@thekarinka thekarinka linked a pull request Apr 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants