gambitph / Titan-Framework

The easiest to use WordPress option framework.
http://www.titanframework.net
380 stars 137 forks source link

create multiple option with same id #407

Closed mrjk990 closed 6 years ago

mrjk990 commented 6 years ago

hi i am working on movies wordpress theme ,this theme need multiple embeds code i am trying to add multiple textarea with same name to add all embedded code's into an array

html example

    <textarea name="embed[]" cols="60" rows="3" tabindex="30"></textarea>
    <textarea name="embed[]" cols="60" rows="3" tabindex="30"></textarea>

in titan framework


    $additional = $titan->createMetaBox( array(
        'name' => 'Additional Post Options',
        'post_type' => 'movie',
    ));

    $additional->createOption([
        'name' => 'Textarea 1',
        'id' => 'embed[]',
        'type' => 'textarea',
        'desc' => 'embed code'
    ]);

    $additional->createOption([
        'name' => 'Textarea 2',
        'id' => 'embed[]',
        'type' => 'textarea',
        'desc' => 'embed code'
    ]);```
should be save as array 

i got error "Titan Framework Error: All option IDs per namespace must be unique. The id embed[] has been used multiple times."

any idea to make it work with titan framework?
bfintal commented 6 years ago

Hi, unfortunately this Titan doesn't support a repeating options. The only way to do something like this right now is to do multiple options.