WordPress: Add Custom Text Field Subpanel / Document Manager

See attached MS Word Doc for the same description, but easier to read.

Modify Custom Post Type Plugin
Add Custom Text Field subpanel / Document Manager

This job involves custom post types in WordPress 3.0+. I need to modify the “Custom Post Type UI” plugin. The current plugin allows the user to add post types and taxonomies, but not add custom fields and edit the custom post type panel. I need to add a custom field and create a new subpanel. This will involve simple text fields, and a text field which will be a file URL, and manages a document directory (files in a specific directory/subdirectories).

I need to create a custom subpanel in the custom post type panel (or post or page) for a custom field. There will be two new submenus in the “Custom Post Types” administrative menu:
• Custom Post Types
o Custom Post Types
o Add New
o Manage Post Types
o Manage Taxonomies
o Document Manager
o Custom Fields

Custom Fields
The panel could list existing custom fields from the wp_postmeta table (if this is not possible, just let the user add custom fields). The custom field list will allow the user to edit the field. Or there will be an “Add New Custom Field” button at the top. There will be four properties:
1. Field Type ( radio button for “Simple Text” or “Document Manager”).
2. Name/title of subpanel
3. Description which will display at beginning of subpanel
4. There will be a list of checkboxes to determine which post type panels the subpanel will be added (post, page, MyCustomField1, MyCustomField2, etc.).

Document/File Management
The purpose is to manage a library of files for a custom post type (“documents”). All files will be located in a subdirectory of a root directory (example: wp-contents/file-library/). Subdirectories will be managed by the plugin.

The Document Manager panel will allow the user to select the root document file.

Document Manager control – The custom subpanel should be a textbox along with a “Select File” button that opens up a directory listing of the files in a root directory (example: wp-contents/file-library/). The user can either select a file from the server, and it the custom field will be populated by the directory/subdirectory/docname. OR, the user can select a file from their local computer, select the subdirectory (or add one), and it will upload the file and then insert the file url into the custom field.

Leave a Reply

Your email address will not be published. Required fields are marked *