0

I'm using the plugin URL Params (homepage) in order to send an URL to a page and after three seconds redirect the user to that page. Unfortunately Wordpress 4.3 broke that functionality.

This is how it was done:

<META HTTP-EQUIV="Refresh" CONTENT="3; URL=[urlparam param="link"]">

The redirect only redirects the user to http://www.sitename.com/redirect/[urlparam%20param=

A work around is putting a link and placing it like this but then I loose the auto redirect.

<a href='[urlparam param="link"]'>

Does anyone know how to rewrite the meta tag so that the redirect could work?

  • Plugin only add shortcode, but not execute it as far as i see. I don't see how it was even working before 4.3 – Butuzov Aug 27 '15 at 9:27
  • can you pass the code, which is generating the <META HTTP-EQUIV="Refresh" CONTENT="3; URL=[urlparam param="link"]"> – websupporter Aug 27 '15 at 9:39
  • @websuporter I might missunderstand you but the meta lin is copied directly from the Wordpress page. As you see it here is just how it looks. The URL with the parameters look like this: example.com/redirect/?company=Industrypartner&link=http://… – John Aug 27 '15 at 10:08
2

You need to allow the content attribute of a meta tag to contain a shortcode, eg in your "functions.php" add:

add_filter( 'wp_kses_allowed_html', function ( $allowedposttags, $context ) {
    if ( $context == 'post' ) {
        $allowedposttags['meta']['content'] = 1;
    }
    return $allowedposttags;
}, 10, 2 );

and then your original (without the quotes in param=link)

<META HTTP-EQUIV="Refresh" CONTENT="3; URL=[urlparam param=link]">

should work.

  • That line of code redirects me to the following URL: example.com/redirect/… – John Aug 27 '15 at 11:06
  • That looks as if the php is being escaped, and hence not being parsed, use a text editor to add the code to whatever file you're editing... – bonger Aug 27 '15 at 11:39
  • I guess I should be using the code when editing a php file, I added it in the editor mode. Any chance of getting this to work from the editor? Editing the physical files is not an option unfortunately. – John Aug 27 '15 at 12:11
  • 1
    Works just fine now! Thank you for taking your time to help me on this - highly appreciated! – John Aug 27 '15 at 13:32
  • 1
    That was an easy fix, never thought of that. Thank you for helping me once again! – John Oct 8 '15 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.