WordPress.org

Forums

Plugin example that creates new tables? (3 posts)

  1. bucky
    Member
    Posted 10 years ago #

    I am looking for code that correctly handles table creation for a plugin. wp_postmeta won't be the right thing for what I have in mind (my Primary key would be a WikiWord, for one thing).

  2. If you just want to add data to the wp_options table (which seems to be common practice), just read through this guide: http://codex.wordpress.org/Writing_a_Plugin#Saving_Plugin_Data_to_the_Database

    I have only used three plugins that actually create database tables. They appear to create the tables upon activation and seem to require WP's upgrade scripts to do so. Here are the plugins:

    http://www.ioerror.us/software/bad-behavior/
    http://unknowngenius.com/blog/wordpress/spam-karma/dev/
    http://uberdork.supertwist.net/2005/03/13/plug-it-in-plug-it-in/

  3. bucky
    Member
    Posted 10 years ago #

    thanks, I see the pattern to use now! cheers

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags