WordPress.org

Support

Support » Plugins and Hacks » Google Maps Ready! » [Resolved] Generates non-valid HTML, suggested fix

[Resolved] Generates non-valid HTML, suggested fix

Viewing 6 replies - 1 through 6 (of 6 total)
  • 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.

    Plugin Author Google Maps plugin

    @google-maps-plugin

    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.

    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

    Plugin Author Google Maps plugin

    @google-maps-plugin

    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?

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Generates non-valid HTML, suggested fix’ is closed to new replies.
Skip to toolbar