Title: Dynamic button URL
Last modified: June 8, 2018

---

# Dynamic button URL

 *  [davidjkfink](https://wordpress.org/support/users/davidjkfink/)
 * (@davidjkfink)
 * [8 years ago](https://wordpress.org/support/topic/dynamic-button-url/)
 * Hello,
 * I need to create a button whose URL is populated dynamically. Specifically I 
   want the link to contain some url parameters taken from the url parameters from
   the current page. I tried using this plugin: [https://wordpress.org/plugins/url-params/](https://wordpress.org/plugins/url-params/)
   which works great, but unfortunately it seems that I can not use shortcode inside
   of the button’s url field. How can I resolve this?
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Bas Schuiling](https://wordpress.org/support/users/basszje/)
 * (@basszje)
 * [8 years ago](https://wordpress.org/support/topic/dynamic-button-url/#post-10381173)
 * This is something that needs to be solved with some code I’m afraid.
 * You can use shortcodes within templates to get the URL you require, something
   like this :
 *     ```
       $param = sanitize_text_field($_GET['param']);
       echo do_shortcode("[maxbutton id=1 url="http://example.com?param=$param]"); 
       ```
   
 * There is also a filter in maxbuttons for URL’s called ‘mb-url’ and ‘mb-url-x’,
   where the X is for button_id, so you can filter per button.
 * I’m not sure what you are trying to do, but those might help.

Viewing 1 replies (of 1 total)

The topic ‘Dynamic button URL’ is closed to new replies.

 * ![](https://ps.w.org/maxbuttons/assets/icon-128x128.png?rev=1378636)
 * [MaxButtons - Create buttons](https://wordpress.org/plugins/maxbuttons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/maxbuttons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/maxbuttons/)
 * [Active Topics](https://wordpress.org/support/plugin/maxbuttons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/maxbuttons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/maxbuttons/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Bas Schuiling](https://wordpress.org/support/users/basszje/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/dynamic-button-url/#post-10381173)
 * Status: not resolved