Support » Plugin: KC Settings » [Plugin: KC Settings] Storing json object for js charts?

  • Greetings!

    KC Settings is an absolutely phenomenal plugin and my favorite options framework by far! Thank you!

    I’m still trying to figure out the best method to do this, and it may not be using kc settings, even though I’m already using it on the site for other things.

    I’m trying to store mulitidimensional arrays as post metadata. There’s an option for multiple input which is superb as the length of the array is variable. It’s exactly what I’m looking for except now all I need is the ability to nest values into a multidimensional array.

    Although I can add entries as needed in the options framework settings, then work with them in the editing post section, I’d like to be able to modify them all in the edit post section. The number of values will be different per post, and if I’m setting this up for others to use.

    I’m thinking that I’d need to hack the code, but not sure the best method. Any chance you could point me in the right direction? Or should I use another plugin/framework?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Dzikri Aziz



    Thank you for using KC Settings.

    I think your best option is to use the ‘special’ field type and create a custom function as the callback to handle the form fields. I do this all the time for my freelance work when the available field types can’t handle my needs.

    The arguments passed to the callback function should be more than enough for you to fiddle with, and feel free to let me know if you need help.

    Hey Dzikri Aziz,

    Thanks for the quick reply! That’s a very good point. I’m not terribly adept with that function, but wouldn’t that mean basically creating your own input form? And if yes, does that require you to store it yourself with update_metadata()?

    I guess what I’m saying is, do you think you could throw up an example of how you use it to get me up and running a lot quicker?

    I apologize if some of my questions/interpretations aren’t terribly knowledgeable. I don’t have the code in front of me, or the time to dig into it at the moment. But I’ll definitely work on it tomorrow. And example would help jump start me into things. Thanks!

    Plugin Author Dzikri Aziz


    No, you don’t need to do the updating part, the plugin will handle this for you 🙂 All you have to do is display the fields based on the values you get from the arguments passed to your callback functions.

    For the example, take a look at functions kc_sample_callback_* in the sample file kc-settings/kc-settings-inc/doc/sample/01_plugin.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: KC Settings] Storing json object for js charts?’ is closed to new replies.