• I’m using a customized version of WordPress 2.2. Later versions don’t work for my specific purpose because of the new revisions features.

    I have a lot of additional fields in the ‘posts’ table in the database (‘tagline’, ‘url’, ‘address’, etc.). I’m trying to edit edit-form-advanced.php to add these fields to the editor page in admin.

    Where is the code/query that stores the data from the edit-form into the ‘posts’ table? Which files should I edit to add my custom fields?

    The Custom Field option does not seem relevant, it only stores meta data somewhere. I need to add data to my existing custom fields in the database.

Viewing 2 replies - 1 through 2 (of 2 total)
  • It sounds to me like you created your own customized fields in the database, which are not ordinary WordPress Custom Fields?

    Why did you choose not to use WP’s normal Custom Fields? Could you switch to it now? I think it would be much easier to work with the existing built-in system already intended for this purpose.

    If using normal Custom Fields…. then it is easy to add them to your Write Posts page with the plugin called Custom Fields Template.

    If using normal Custom Fields… then it is easy to add data to any of your existing custom fields. But you are right, I don’t think you can teach Custom Fields to add data to some non-WP field that you hand-created in the database.

    I think I’d recommend switching to Custom Fields.

    How were you entering this data in the database anyway, without the Custom Fields? You went into MySQL to do it?

    One more thing, you can disable the Post Revisions feature in WP 2.6+, so perhaps you will be able to upgrade to the latest WP afterall.
    http://lesterchan.net/wordpress/2008/07/17/how-to-turn-off-post-revision-in-wordpress-26/

    Hope this helps!

    Please post more about what you are seeking to accomplish if I misunderstood.

    Thread Starter Modifiedcontent

    (@modifiedcontent)

    In this case I use WordPress to manage a table of “records” instead of blog posts. I already had this table with another script, but needed a flexible category system like WP has.

    Yes, I went into MySQL to add these fields. I’m not a PHP/SQL coder, but I’m trying to get to the basics, not pile on more WP specific code and plugins.

    Again, as far as I can tell the Custom Field option stores data as meta data, not regular fields. That is no good, because I want to be able to access the same “records” table through other scripts.

    Even with turning off post revision the latest versions of WordPress don’t seem to keep the integrity of the records. They still create new versions with new IDs.

    I also couldn’t get custom permalinks to work in my modified WP 2.6 experiment. In 2.2 it works beautifully. For straightforward blogging WP 2.6+ is fine, for anything else WP has jumped the shark imho.

    So no, thanks for your effort, but your post was not helpful at all. I deliberately mentioned these points in my original question, hoping to avoid answers like yours.

    So forget all that, here’s my question again:

    I have manually added several custom fields in the ‘posts’ table in the database (‘tagline’, ‘url’, ‘address’, etc.). I’m trying to edit edit-form-advanced.php to add form input elements for these fields to the editor page in admin.

    Adding the form input elements is not that complicated, getting the input stored is trickier. Where is the code/query that stores the data from the edit-form into the MySQL ‘posts’ table? Which WP files are involved in this process?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Add wp_posts custom fields to editor in version 2.2’ is closed to new replies.