6 thoughts on “WordPress GET Params

  1. Phil

    Love the plugin thanks Dan!

    Is there any way to use the param to write not only get the param from http://www.website.com/page/?DANS_PARAM=somevalue then write it to the users’ database? Something along the lines of…

    $user_id = get_current_user_id();
    update_user_meta($user_id, ‘SOME_VARIABLE’, ‘DANS_PARAM’);

    (I’m also using a plugin that adds PHP to invididual pages)

    Reply
    1. Dan Post author

      Phil,

      Glad you like the plugin!

      To be honest, there would be absolutely no need to use the GET Params plugin if you are writing PHP code anyway… you’d just use the $_GET variable to check the GET parameters directly. The plugin is only useful if you don’t have direct access to PHP.

      Thanks,

      Dan

      Reply
  2. Phil

    Thanks for the quick reply, can you guess I’m a PHP novice? That makes sense and thanks for your help.

    Reply
  3. fgus

    hi, i would like to show custom content based on a variable value in url, like mysite.com?ref?= bob
    i can see some plugins including yors that do that, the problem is that I cannot find a way to keep the variable along all my site pages, so when visitor navigates the website the ref=bob parameters are lost, do u know if there is a way to pass the value to all url pages/post?
    im driving crazy with this step 🙂
    thanks

    Reply
  4. Boji

    Hi Dan,

    I’m using this plugin and it works very well for “standard” param values, but I’m having difficulties with German, Spanish, etc. characters: öñß, etc.

    I’ve tried encoding the URLs, for example: https://www.swalk-app.com/new-user-welcome/?username=B%C3%B6ji+Dad%C3%B1k

    and I was expecting to see “Böji Dadñk”, but instead I get “Böji Dadñk”. You are welcome to try the above URL and see the behaviour for yourself.

    What I noticed is that the URL changes to “https://www.swalk-app.com/new-user-welcome/?username=Böji+Dadñk” when the page is loaded. I tries on Safari and Firefox on a Mac and also on a PC, same behaviour.

    Do you have any suggestions?

    Thanks a lot in advance!

    Reply
    1. Dan Post author

      Thank you for your message.

      I have tried using the same text in a test on my site and it seems to work OK.

      The URL also changes in the browser as you describe, but it displays correctly.

      So it could be something to do with the character encoding settings on your site – I’m not too sure to be honest.

      By the way, if you have any further questions it could be best to email me or use the forum on the wordpress.org repository – other users may be able to help better there if they have come across the same problem.

      Thanks,

      Dan

      Reply

Let me know what you think!