WordPress.org

Ready to get started?Download WordPress

Forums

Options and Manage pages (6 posts)

  1. Ajay
    Member
    Posted 9 years ago #

    I want to add an options and a manage page for my plugin.

    I am aware on the code to create this in WP Admin.

    I've seen other plugins which have a few settings under the Options page

    How do I do this so that I can set / update the variables that the functions in my plugin file uses.

    I hope the question is clear.

  2. Kafkaesqui

    Posted 9 years ago #

    WordPress provides a few plugin functions for saving and retrieving data in the options table:

    http://codex.wordpress.org/Writing_a_Plugin#Saving_Plugin_Data_to_the_Database

  3. Ajay
    Member
    Posted 9 years ago #

    Thanks Kaf, got the thing working after lots of trial and error!

  4. Ajay
    Member
    Posted 9 years ago #

    Another question on this topic.

    update_option($option_name, $newvalue);

    How do I pass an Array as the value of $newvalue ??

  5. Firas
    Member
    Posted 9 years ago #

    $newvalue = array('hi', 'test', 'etc');
    update_option($option_name, $newvalue);

    or

    update_option($option_name, array('hi', 'test', 'etc'));

    Just like any php function.

  6. Ajay
    Member
    Posted 9 years ago #

    So I assume I can even use $option_name = some_name and then use update_option

Topic Closed

This topic has been closed to new replies.

About this Topic