Question

If I am not mistaken, the settings api only storing one single data array in wp_options table. You can only change the field data in the array.

What if I want to add multiple array in the same table with same array structure but different value.

What I mean is :

$data = array(
    '1' = array(
        'cpt'=> 'cpt1',
        'date'=> 'date1',
        'role'=> 'subscriber'            
    ),
    '2' = array(
        'cpt'=> 'cpt2',
        'date'=> 'date2',
        'role'=> 'eiditor'       
    ).....etc
 );

and I can add new array, edit the field inside either one of the array,or delete unwanted array.

What I found on goolge are only tutorial on how to store the data in single array, but I did see some plugin done this, but just couldn't understand how they done it with my current of programming level.

I don't want to create another custom table,since the data that I want to store is not so much. I only store some setting (user,post-type,post date) for further use.

Any guides or advice will be appreciated.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top