The MU forums have moved to WordPress.org

Plugin design (5 posts)

  1. miteshashar
    Member
    Posted 16 years ago #

    I am creating a new WPMU plugin.
    I wanted to create my own db table & was going thru the http://codex.wordpress.org/Creating_Tables_with_Plugins guide.

    It says this action needs to be added:

    add_action('activate_plugindir/pluginfile.php', 'jal_install');

    I cant figure out the first parameter I need to enter to create a plugin for the mu-plugins folder.

  2. mark-k
    Member
    Posted 16 years ago #

    There is no activation hook for plugins in the mu-plugins directory since by definition they are always active. If you need to create a table you can simply check if it exists and create it if not.

    BTW, why create a table at all? have you considered using blog or site options instead?

  3. miteshashar
    Member
    Posted 16 years ago #

    OK. got that.

    Newayz, wanna create a table because I think it'll be gimme some efficient data management, because I'll be having a flag about each blog that is present, which I need to list on a WPMU Site Admin Menu.
    So that would tend me to call the get option function for each blog.

  4. mark-k
    Member
    Posted 16 years ago #

    In that case you can store an array in an option. The option related functions know how to serialize and unserialize arrays.

    IMHO it will actually be easier and cleaner coding approach than creating a DB table, and since WPMU performs caching on the options, it might even be faster.

  5. miteshashar
    Member
    Posted 16 years ago #

    ok...cool...
    so i just pass on the array as a parameter to the add option function

About this Topic

  • Started 16 years ago by miteshashar
  • Latest reply from miteshashar