Create multiple shortcodes
<p>I am creating a Wordpress Plugin that creates shortcodes. I want to load those shortcodes with an given name via my plugin.</p>

<p>like this <code>[name]</code></p>

<p>But when I save my shortcode the shortcode is generated but not saved</p>

<p>What am I doing wrong.</p>

<p><strong>This is my form</strong></p>

<pre><code>&lt;form method="post" enctype="multipart/form-data"&gt;
&lt;table&gt;
    &lt;tr&gt;
        &lt;td&gt;
            Naam:
        &lt;/td&gt;
        &lt;td&gt;
            &lt;input name="naam" type="text" placeholder="Geef hier een unieke naam op" required/&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            Site URL:
        &lt;/td&gt;
        &lt;td&gt;
            &lt;input name="url" type="text" placeholder="Site URL" required/&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            Breedte:
        &lt;/td&gt;
        &lt;td&gt;
            &lt;input name="breedte" type="text" placeholder="Breedte in pixels" required/&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            Bevestig:
        &lt;/td&gt;
        &lt;td&gt;
            &lt;?php submit_button('Upload') ?&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
</code></pre>

<p><strong>On post:</strong></p>

<pre><code>if(isset($_POST['naam'])) {
    $naam = $_POST['naam'];
    $url = $_POST['url'];
    $breedte = $_POST['breedte'];
    createShortcode($naam, $url, $breedte);
    add_shortcode($naam, 'createShortcode');
}
</code></pre>

<p><strong>Create shortcode function</strong></p>

<pre><code>function createShortcode($naam, $url, $breedte){
    echo 'Naam: ' . $naam . ' ';
    echo 'URL: ' . $url . ' ';
    echo 'Breedte: ' . $breedte . ' ';
}
</code></pre>