Forums

Custom Field Hack (3 posts)

  1. nallu
    Member
    Posted 1 year ago #

    Hello all,

    I am currently facing an issue with 'Custom fields' metabox. In addition to the Name, Value in the custom fields metabox, I want to add a third column called 'Link' and then store its value in the database as well.

    I don't want to change the codebase and looking for a good solution for the above stated issue.

    Can anybody provide me a direction for the same?

    Thanks in advance

  2. ambrosite
    Member
    Posted 1 year ago #

    I think you are misunderstanding how custom fields are supposed to work. Name and Value map directly to the meta_key and meta_value columns in the wp_postmeta table, so it would be impossible to add a third column as you describe without altering the table definition. If you want to add a link to a post as a custom field, the Name should be 'link' (or something similar), and the Value would be the link itself. You can add as many custom fields as you want.

  3. nallu
    Member
    Posted 1 year ago #

    thanks for the reply

Topic Closed

This topic has been closed to new replies.

About this Topic