WordPress.org

Ready to get started?Download WordPress

Forums

Custom Page/Post Types (4 posts)

  1. apakuni
    Member
    Posted 8 years ago #

    I know that we have the ability to add custom fields to an individual post. I am wondering if there is a means (plugin/hack) to create a pre-defined post or page type. I've seen individual plugins (ex. GeoPress, ipodcatter) that add additional data to a post, but am talking about a common infrastructure that would result in a drop down selector at the top of the "Write" page that would let me select a specific type of post (ex. GeoPress, Travelouge, Podcast).

    Once selected, I would then get whatever custom fields are included for that specific post/page type. For example, if it were a PodCast, I would see "Show Notes", URI (if external feed), Upload button (if posting the MP3 to server) and any other fields required to create a valid iTunes RSS feed.

    Rather than building infinite variations on the same theme, it seems like WP needs a common infrastructure/manager for this functionality. Then devs can build against it in a consistent way. This allows even simpler UI and data elements.

    In Xaraya, the plan was to make the posts table infinitely malleable by linking it to a dynamic data table that would hold all of the custom fields. As I recall, this proved problematic over time. I would suggest that all of the core post data remain consistent. Then devs of "post/page type" could be free to build DB tables for just their custom data and the core post/page type system would hook the two together for I/O.

    Thoughts?

  2. skeltoac
    Member
    Posted 8 years ago #

    Hooks hooks everywhere! There is a hook to add UI elements to the Write screen, a hook to kick off operations (such as db table creation) on plugin activation, a hook to notify WP when you've brushed your teeth. This is best left to plugin authors IMO.

  3. Kafkaesqui

    Posted 8 years ago #

    I agree. There's a risk with making the post table too generic and "malleable." Also, just sticking in some appropriate hooks would let the userbase and plugin developers decide the direction such a feature can and should go.

  4. Dougal Campbell
    Member
    Posted 8 years ago #

    The majority of users don't need this type of functionality to be ever-present. So, it's best done as a plugin.

    As skeltoac said, there are already hooks available for such a framework to be added as a plugin. This wouldn't be the first case of a plugin which added capabilities meant to be used by other plugins :)

    I don't think that there would be too many cases where adding a whole new table would be necessary, unless the "key/value" capabilities added by the standard custom fields couldn't be extended easily for a particular case.

Topic Closed

This topic has been closed to new replies.

About this Topic