Support » Plugin: WordPress PDF Templates » query string

  • Hi, Great plugin and works very well. I have created a custom template querying a custom db table with a query string. It works as expected without a query string but when a query string is added the page shows the correct content but the pdf shows with out. i.e /?var=value&pdf. It is like the GET can not be used. is there any way to pass parameters?

    Many Thanks

    https://wordpress.org/plugins/wp-pdf-templates/

Viewing 7 replies - 1 through 7 (of 7 total)
  • I know this is an old topic but I came across the same issue. I was able to get it to work by modifying the wp-pdf-templates.php file on lines 208 and 209:

    $permalink = get_the_permalink() . '?' . $_SERVER['QUERY_STRING'];
    $url = parse_url($permalink);

    and line 253:

    $link = $permalink;

    It seems like since the plugin was just using get_the_permalink it wasn’t taking the query string into account at all.

    • This reply was modified 2 years, 6 months ago by voltagekc.

    Hi guys, how are you grabbing the values, I tried $_GET[“myvar”]; without success.

    Also, are POST methods out, are we limted to GET?

    Any way to pass logged in user data, since no pdf is generating for restricted site

    Plugin Author Viljami Kuosmanen

    (@zuige)

    Just add

    define('FETCH_COOKIES_ENABLED', true);

    to your wp-config.php

    Hi Viljami, is your response to address the querystring question or the logged in data question?

    Thanks

    Plugin Author Viljami Kuosmanen

    (@zuige)

    Oh, right. It’s actually just for the logged in data question. Sorry.

    For the query string issue, I’m not at all sure why this is happening.

    Hmm, so I should be ok to use $_GET[“myvar”] on the template page? I’ll do some debugging when I get chance…

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘query string’ is closed to new replies.