WordPress.org

Forums

Google Maps Ready!
[resolved] Generates non-valid HTML, suggested fix (7 posts)

  1. LiamLaverty
    Member
    Posted 1 year ago #

    Hey,

    The plugin is great, but generates non-standard html. I made a suggestion for a quick fix on Github, which redirected me here. You can see the suggestion here:

    https://github.com/liamlaverty/google-maps-ready/compare/patch-1

    The issue is that there's a <style> tag where there shouldn't be one. All I did was add it to the wp_head hook.

    https://wordpress.org/plugins/google-maps-ready/

  2. Ready! Developer
    Blocked
    Posted 1 year ago #

    Hello.
    Thank you for support, this is great.
    But did you tried this solution? I understand what you mean - put all <style> tag inside <header> using wp_head hook. I can but to such callback all variables (like $mapWidth, $height, etc.), but shortcode can be in any place of content, most likely it will be in post or page content, and wp_head event will be already triggered at moment when we start draw map, so it will not output styles on user page. Maybe I didn't understand fully your idea, if so - can you please explain it more?

    Regards,
    Alexey.

  3. Google Maps plugin
    Blocked
    Plugin Author

    Posted 1 year ago #

    Hello.
    Unfortunatelly, we didn't found out solution to generate data into <head> when shortcode is called after <head> was generated. I think in current wordpress shortcodes functionality this is impossible.

    Regards,
    Alexey.

  4. lieutenantdan
    Member
    Posted 9 months ago #

    This is most definitely not impossible and I don't see how it is marked resolved. Simply scan the post content for your shortcode before wp outputs the head... as explained here: http://wordpress.stackexchange.com/questions/101498/redirect-function-inside-a-shortcode/101515#101515

  5. Google Maps plugin
    Blocked
    Plugin Author

    Posted 9 months ago #

    Hello.
    Thank you for suggestion, but I see there that it will use regular expression for entire post/page content, and I really don't think that this is good idea to do this before show each post/page. What do you think?

  6. lieutenantdan
    Member
    Posted 9 months ago #

    Why would it not be a good idea? The regex is simply for scanning the content, not changing it. You can use it to detect the shortcode, get it, then add the CSS to the head then users using your plugin will be able to validate their code.

  7. lieutenantdan
    Member
    Posted 9 months ago #

    ...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.