WordPress.org

Forums

Custom Content Type Manager
[resolved] Creating and storing a Calculated Value (3 posts)

  1. Dirty Bill
    Member
    Posted 2 years ago #

    I have the need for a calculated field and a way (place) to hook it so that it is calculated and stored when a news custom type record is created. I've been going through the documentation, but I'm not completely certain what would be the best way to do it within the system.

    Specifically: I'm creating a database of several hundred locations - I need a (geocode) latitude and longitude for each. Requesting them each time I use them isn't reasonable, so I'd like to call a lookup of the geocode from an address in the record and store it. Ideally this would happen as the input form gets validated.

    Any suggestions would be welcome.

    Thx -DB.

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    I did add some dynamic PHP functionality to CCTM hidden fields: you can add code there that executes when a record is created or updated. If you want that field to be visible, you can update its template and change it to use a standard text field (see https://code.google.com/p/wordpress-custom-content-type-manager/wiki/CustomizingManagerHTML)

    Hope that helps.

  3. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    The latest dev version includes more functionality here with the hidden fields. I may add that special PHP calculation stuff to the normal fields (text, relations, etc.)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Content Type Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic