title: creating a variable shortcode based on user input that returns (prechosen) variables Wordpress
body: <p>I need to update values in all posts of a wordpress installation on a regular base. I was gooing to use shortcodes to insert the request into the wordpress post. Then use a custom functions.php that holds all the variables that need to be updated from time to time.</p>
  <p>I got it working. Somehow but not the way I intended to use it. I'm a total beginner. Please consider this when answering my questions.</p>
  <p>I want to have a function that reads what comes after honda_ and displays the correct value in wordpress without having to create a separate shortcode for each variable.</p>
  <p>When entering [honda_link] wordpress should display the value from honda_link. When entering [honda_longlink] the value from honda_longlink variable should get displayed. I don't want to create a shortcode for each value.</p>
  <p>I came up with this as a working solution...</p>
  <p><code>// Honda</code></p>
  <p><code>function honda() {</code></p>
  <p><code>$honda_link = '</code><a href="https://www.honda.com" rel="nofollow noreferrer"><code>www.honda.com</code></a><code>';</code><br />
  <code>$honda_longlink = '</code><a href="https://www.honda.com" rel="nofollow noreferrer"><code>http://www.honda.com</code></a><code>';</code><br />
  <code>$honda_free = 'Free';</code><br />
  <code>$honda_new = '23.688 $';</code><br />
  <code>$honda_mileage = '00';</code><br />
  <code>return $honda_link;</code>
  <code>}</code><br />
  <code>add_shortcode('neu', 'honda_link');</code></p>
  <p>I tried some approaches by using an array but it ultimately failed all the time. I also tried it with if statements but wasn't able to get the right value displayed.</p>
  <p>Someone willing to help a noob? I think I need to see a working example in order to understand it. The code snippets I have been looking at (that do something similiar but not the same I want to achieve) did confuse me more than they helped me.</p>