• Hi,

    I am rewriting an orphaned WordPress plugin and would like to make its use of custom fields compatible with CCTM. The current version creates a custom post type (for making timelines); I would like, instead, to just create a few custom fields and generate timelines from arbitrary WP content.

    If CCTM is not installed, I’d like to just create the fields and ass them to existing content types. If, on the other hand, CCTM is installed and activated, I would like to register the fields properly so that users can deside what content types to attach these fields to.

    The fields are also housed in metaboxes which I’d like to place under CCTM management as well.

    Is there a best practice for doing this kind of thing? I am notquite sure how to go about it.

    My code, such as it is, is here:

    https://github.com/titaniumbones/wp-veriteco-timeline/tree/rewrite

    thanks,

    Matt

    https://ww.wp.xz.cn/plugins/custom-content-type-manager/

Viewing 1 replies (of 1 total)
  • Plugin Contributor fireproofsocks

    (@fireproofsocks)

    This could be tricky, and it’s a custom job, so I can’t really comment on “best practices”. Since this relates to the plugin’s architecture and how data is stored, I’ll point you to this heady discussion: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/CustomFieldsDataStructure

    Re assigning fields, there are 2 things there — one is how the data is stored. If WordPress wrote the data, then the association between field and post exists inherently in the wp_postmeta table. If you’re talking about the CCTM however, it maintains its own associations for assigning a field to a post type (thus the standardized set of fields).

    I generally would not recommend trying to mix and match that way — I feel WP in particular is poorly suited to customizations like that. You may want to have a look at the code in the dev branch: it features a “detect custom fields” wizard that will read the database for existing values and let you create custom field definitions to match those values.

Viewing 1 replies (of 1 total)

The topic ‘registering foreign custom fields with CCTM’ is closed to new replies.