Custom Content Type Manager
Version: 0.9.7.13 Break out of your blog! Create custom fields for dropdowns, images, and more! This plugin gives Wordpress true CMS functionality.
The Custom Content Type Manager (CCTM) allows users to create custom content types (also known as post types) and standardized custom fields for each, including dropdowns, checkboxes, and images and more! This gives WordPress CMS functionality: Break out of your Blog!
You can select multiple images, posts, or media items to be stored in a single field making it easy for you to store a gallery of images or long lists of values. This plugin also lets you export and import your content definitions, making it easy to ensure a similar structure between multiple sites.
Check the site for a full list of features.
This plugin was written in part for the book WordPress 3 Plugin Development Essentials, published by Packt.
Please use the following links for support and discussion:
- Please sign up for the CCTM Mailing List
- Participate in the Forum
- File Bug reports or make feature requests.
- Read the Official documentation
- WordPress 3.3.0 or greater
- PHP 5.2.6 or greater (5.3 recommended, with scandir)
- MySQL 4.1.2 or greater (5.x recommended)
|Tags||cms, content management, custom content types, custom fields, custom post types, ecommerce, image fields, images, modx|
After activating this plugin, you can create custom content types (post types) by using the configuration page for this plugin. Click the "Custom Content Types" link under the Settings menu or click this plugin's "Settings" shortcut link in on the Plugin administration page.
You can list all defined content types (a.k.a. post-types) by clicking on the "Custom Content Types" menu item.
There are a lot of options available when you create a new content type, only some of them are pictured.
You can define many different types of custom fields by clicking on the "Custom Content Types --> Custom Fields" link.
Clicking the "activate" link for any content type will cause its fields to be standardized and it will show up in the administration menus.
Once you have defined custom fields and associated them with one or more content types, those custom fields will show up when you create or edit a new post.
This plugin uses the standard installation procedure: install the plugin's folder inside of
wp-content/plugins (make sure the folder is named custom-content-type-manager).
Here is a typical use-case verbosely for the record:
- Install this plugin using the traditional WordPress plugin installation, or upload this plugin's folder to the
/wp-content/plugins/directory (ensure that the directory is named custom-content-type-manager).
- Activate the plugin through the 'Plugins' menu in the WordPress manager.
- Upon activation you can adjust the plugin settings by clicking the newly created "Custom Content Types" menu item, or click this plugin's "Settings" link on the Plugins page.
- After clicking the Settings link, you will see a list of content types -- there are two built-in types listed: post and page. To test this plugin, try adding a new content type named "movie" by clicking the "Add Custom Content Type" button at the top of the page.
- There are a lot of options when setting up a new content type, but all the necessary ones are shown on the first page. Pay attention to the "Name", "Show Admin User Interface", and "Public" settings. "Show Admin User Interface" must be checked in order for you to be able to create or edit new instances of your custom content type.
- Save the new content by clicking the "Create New Content Type" button.
- Your content type should now be listed under on the main Custom Content Types Manager settings page. Activate your new content type by clicking the blue "Activate" link.
- Once you have activated the content type, you should see a new menu item in the left-hand admin menu. E.g. "Movies" in our example.
- Try adding some custom fields to your new content type by clicking on the "Manage Custom Fields" link on the settings page.
- You can add as many custom fields as you want by clicking the "Add Custom Field" button at the top of the page, e.g. try adding a "plot_summary" field using a "textarea" input type, and try adding a "rating" dropdown.
- When you are finished configuring your custom fields, click the "Save Changes" button.
- Now try adding a new instance of your content type ("Movies" in this example). Click the link in the left-hand admin menu to add a movie.
- Your new "Movie" post will have the custom fields you defined.
- If you have added any media custom fields, be sure to upload some images using the WordPress "Media" menu in the left-hand menu.
Please note: if you are upgrading from version 0.8.7 or before, you must completely uninstall and remove the previous version! This will not delete any of your content, but you should take some notes about the exact names of your content types before doing this. Sorry, I know it's a pain, but I had to correct for limitations in the data structure. See this Wiki page for more information.
You can always checkout the most recent version of the code at
or by going to your wp-content/plugins directory and executing the following command from the command-line:
svn checkout http://plugins.svn.wordpress.org/custom-content-type-manager/trunk custom-content-type-manager
- Fix for dropdown/radio buttons
- Various fixes.
- Returning to the banal world of scandir after a sunburned excursion to FilesystemIterator
- Support for conditional metaboxes.
- Added unit tests for SP_Post class.
- Cleanups of various bugs.
- Fixes bug with pagination in the Thickbox (used for all relation, image, and media fields).
- Adding new Relation-Meta field.
- Various other bug-fixes.
- Fixes a few more minor fixes.
- Fixes glitch in 0.9.7.2 in Summarize Posts shortcode.
- Unit Tests added for Summarize Posts shortcode and operators.
- Added support for cctm_post_form shortcode: now you can have users on the front-end create posts (see feature request 132).
- Added "join" argument to GetPostsQuery::get_posts()
- Added datef output filter for date formatting.
- Added number output filter for number formatting.
- Support for custom metaboxes: you can now put your fields anywhere on the admin pages.
- Added a pattern validator which supports simple patterns and full regular expressions via preg_match().
- Added a Directory field type so you can easily list the contents of a directory.
- Various bug fixes.
- Fixed errors with more complex permissions: capabilities, capability_types
- Increased dropdown functionality, including ability to issue MySQL queries, "bulk" importing, and sortable options.
- Improved compatibility.
- Incrementing version because changes were not picked up by the WordPress repo (?)
- Improvements to SP_Post
- Reworking of the CCTM_Pagination library and documentation.
- Various bugs fixed.
- Improved parser to handle output filters in placeholders.
- Lots of general cleanup to consolidate similar functions.
- Improved examples for sample templates.
- Fixed bug in format string for summarize-posts shortcode.
- Now ready to accept translations. Various minor fixes. Unit testing added (woot).
- Customizations for Right Now Widget added.
- Versioning number bump.
- Security vulnerability patched.
- Complex sorting now allowed in GetPostsQuery via 'orderby_custom'
- Various cleanups.
- Release to combat WordPress removing the plugin from their repository for licensing dispute.
- Lots of fixes to the request_filter, search_filter
- Date fields now support times and datetimes!
- Preparing for i18n!
- Quick cache added (issue 351).
- Bugs with duplicating fields fixed. (unreported)
- Added ability to change field types (e.g. from dropdown to multiselect or from textarea to WYSIWYG) -- (Issue 318)[http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=318]
- Added ability to format multi-selects as a multi-select field instead of just multiple checkboxes.
- Fixed interference with WP_Query
- Added ability to standardize custom fields for foreign post-types.
I forgot all the stuff I did for this one, but it must have been really cool.
- Added new "Post Content" widget (beta)
- Fixed several problems with Summarize Posts (including shortcode execution)
- Added Summarize Posts Widget
- Fixed pagination issue with Relation thickboxes.
- You can now mark fields as required!
- Improvements to GetPostsQuery on large data sets.
- Lots of small fixes
- Fixed (Issue 279)[http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=279]: greater compatibility with translation plugins.
- Fixed (Issue 293)[http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=293]: new global setting to prevent unnecessary rows in the wp_postmeta table.
- Fixed (Issue 294)[http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=294]: incorrect email validation for def. export.
- Fixed (Issue 291)[http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=291]: issue with custom database prefixes.
- Fixed (Issue 288)[http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=288]: incorrect formatting of posts on multi-relation, multi-image, and multi-media fields.
- Fixed (Issue 280)[http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=280]: bug with multi-relation (multi-image/multi-media) fields.
(Issue 276)[http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=276]: Fixes issue with sample templates.
- do_shortcode Output Filter added.
- Configuration options added for Post Selector.
- Bug with Media Selector addressed (Issue 273)[http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=273]
Major release! This REQUIRES WordPress 3.3 due to the changes in the TinyMCE implementation.
- Integrated the Summarize Posts plugin: this gives all kinds of power to searching for posts.
- All fields can now be "repeatable" so you can select multiple values, e.g. images, relations, textareas...
- Cleaner Ajax implementation Issue 226. This should make the plugin work better on sites with customized folder structures.
- You can now configure search parameters to determine which posts are available in your post-selector for relation, image, and media fields.
- Removed directory caching option (no longer needed due to code rewrites).
- Now supports "repeatable" fields: you can select multiple images, media items, or relations.
- Code-cleanup in preparation for supporting 3rd party custom fields and the merging of the Summarize Posts plugin.
- Fixed bug with tags/categories and the "getarchives_where" filter.
- Finally fixed upgrading glitch.
- Fixed glitch with custom hierarchies.
- Adjusted default size of text fields.
- Added support for "Right Now" dashboard widget. Issue 200
- Fixed issues with Categories and Archives: Issue 202
- Fixed Issue 196: Wrong link to plugin's settings from the Plugin's page.
- Fixed Issue 197: I had forgotten to uncomment lines that cleaned up field definitions after merging fields.
- Added support for duplication of custom fields: Issue 174
- Added support for duplication of post types: Issue 173
This is a major release:
- Fixed Issue 187 that affected dropdowns and multi-selects: values were not trimmed before comparison, causing the current value to be unselected.
- Fixed Issue 88 that prevented certain UTF8 characters (e.g. Polish) from being saved correctly in multi-select fields.
- Updated Output Filter functionality. See Output Filters in the wiki or Issue 162 and Issue 183 in the bug tracker.
- Added "Wrapper" and "Default" output filters. See Wrapper and Default in the wiki.
- Custom Fields can now implement their own settings page. Issue 161
- Improved help pages on the project Wiki.
- Improved import/export of CCTM definitions.
- Settings page added to give control to the users. See Issue 72.
- New menu icons! See Issue 30.
- Large menu icon now displayed when you edit or create a post type Issue 136.
- Fixed 2 issues Issue 52 and Issue 180 that caused wp_insert_post() to fail in different circumstances.
- Implemented Feature 178: submenus added to the post_type menus.
- Fixed Issue 168 that was preventing the admin user from unchecking "Rewrite with Permalink Front"
- Now CCTM is compatible with the Gravity Forms plugin per Issue 155
- General cleanup of the plugin's directory structure; general move towards MVC organization of all files.
- Finally added some appropriate images to the footer of the admin pages.
- Implemented more advanced dropdown and multi-select options where users can now optionally store distinct values and labels for each option. See Issue 150.
- Revisited Issue 146, discovered WordPress is adding slashes to $_POST, $_GET, $_COOKIE, and $_SERVER arrays (see this article. WHY IS WORDPRESS DOING THIS???
- Fixed some lingering PHP notices in date.php (whoops).
- Added method for Custom Field PHP classes to let each field add JS/CSS to the manager via the "admin_init" function. See Issue 71.
- Cleaned up PHP notices when creating a "Date" custom field.
- Added checks for incompatible plugins Issue 122
- Fixed Issue 145 so you can now include HTML in default values for text and checkbox fields.
- Added support for clean custom field un-installation:Issue 145.
- Fixed Issue 144 so now you can define content types (i.e. post_types) that use numerical names.
- Fixed Issue 143 that prevented proper searching on the front-end.
- Fixed Issue 142 custom post types can now be ordered correctly using the "Order" attribute.
- Fixed Issue 139 that affected editing the names of custom fields -- a new field was created if the name was changed.
- Fixed Issue 138 that affected WYSIWYG custom fields that failed if a content type's main Content block was not active.
- Implemented Feature 126 so that bug reporting is easier: system info is generated for you to cut and paste into the bug report.
- Fixed Issue 114 where custom hierarchies were limited to only 5 items.
- Fixed Issue 115 where the "View Item" label was receiving incorrect values.
- Fixed Issue 121 where Array output filters returned empty string if no options were checked.
- Fixed Issue 123 so that names of custom fields are no longer limited to 20 characters: they now are limited to 255, the maximum possible length given the database column definition (VARCHAR 255).
- Fixed Issue 112 custom page templates were being ignored.
- Fixed Issue 111 with static pages not loading.
- Fixed the archive support -- supporting archives caused pages to 404. This should also correct categories for custom post types.
- Sigh... this is the "correct" release of 0.9.2... !@%# WP repo has thwarted me again.
- Archive support added.
- Bad release with 0.9.1: re-release.
- Typos in editing post_type definition corrected.
- Bugs with media fields addressed, including adding output filters.
- Fixed issue 80 with error-warnings while auto-saving.
- Handled nebulous case with default value Issue 45
- Added custom field: Multi-select
- Added custom field: Color selector
- Added support for customized hierarchical post-types Issue 9
- Fixed mistake in escaping quotes in post_type definitions and custom field definitions.
- Fixed bug in sorting custom fields Issue 70.
- Permalink functionality fixed by flushing rewrite rules after register_post_type()
- Flash messages are now stored in the $_COOKIE array instead of $_SESSION to be in keeping with WordPress' simplistic "stateless" parlance.
- Date field added, including support for PHP eval of default value.
- CSS classes and ids updated (all instances of "formgenerator" were replaced with "cctm").
- Import/Export functionality added.
- Checking of valid image icons was disabled due to problems with segfault in some server configurations see Issue 60
- Bug with page-attributes fixed: you can now correctly enable page attributes for custom content types.
- Support for Post Formats added.
- Support for Output Filters was added.
- Template functions
print_custom_imagewere removed in favor of using Output Filters.
- The FormGenerator class removed in favor of simpler PHP pages.
- More CRUD-like interface for creating and editing custom fields one at a time.
- Object-Oriented class structure implemented for custom fields in accordance with future plans for more field types
- Drag and Drop interface added for Custom Fields to change sort order
- Added support for built-in taxonomies (Categories and Tags).
- Fixed unreported bugs affecting custom tpls.
- Fixed bug causing popup thickbox to load incorrectly: Issue 17
- Styling for the manager updated to match what's used by WordPress 3.1.
- Greatly improved administration interface including support for icons and a series of tabs for dividing the multi-part form for creating/editing content types.
- Reduced MySQL requirements to version 4.1.2 (same as WordPress 3.1) after feedback that the plugin is working fine in MySQL 4: issue 28
- Fixed typos in CCTMTests.php re the CCTM_TXTDOMAIN: issue 29.
- Added optional prefix for template function get_all_fields_of_type(): Issue 26
- Three new template functions added per Issue 25 ** get_custom_field_meta() ** print_custom_field_meta() ** get_custom_field_def() See Template Functions in the wiki.
- Adds HTML head and body tags back to the tpls/post_selector/main.tpl to correct issue 17 (http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=17&can=1).
- Fixes bad CSS declaration: issue 1
- Fixed omission in sample template placeholders.
- Resubmitting to placate WP's repository.
- Resubmitting to placate WP's repository.
- Customized manager templates. This is useful if you need to customize the manager interface for the custom fields.
- Updated sample templates under the "View Sample Template" link for each content type.
- Added image/media uploading functionality directly from the custom fields.
- Control buttons now at top and bottom of manage custom fields.
- Links to bug tracking / wiki for this project.
- Some basic HTML cleanup.
- Moved some files around for better organization.
=0.8.2= * WordPress 3.0.4 fixed some bugs that affected the functionality of this plugin: now you CAN add custom content posts to WordPress menus. * WordPress has not recognized the updates to this plugin (apparently due to a glitch), so currently the only way to get the most recent version of this is to check it out via SVN.
- Fixes problem saving posts. The problem had to do with wp-nonces and the admin referrer was being checked, but not generated, so the check failed. Oops.
- Initial public release. Collaborators can check out code at http://code.google.com/p/wordpress-custom-content-type-manager/
Please see the online FAQ for the most current information.
- WordPress 3.3 or greater.
- PHP 5.2.6 or greater
- MySQL 4.1.2 or greater
These requirements are tested during WordPress initialization; the plugin will not load if these requirements are not met. Error messaging will fail if the user is using a version of WordPress older than version 2.0.11.
This plugin was written in part for the book WordPress 3 Plugin Development Essentials published by Packt. It was inspired by the Custom-Post Type UI plugin written by Brad Williams. The Custom-Post Type UI plugin offers some of the same features, but I felt that its architecture was flawed: it stores data as taxonomical terms, which is conceptually awkward at a development level, and more importantly, it limits the each custom field to 200 characters of data, making it impossible to store certain types of custom content.
On the surface, this plugin is similar, but this plugin "correctly" stores custom field data as post meta data, which allows allows for different input types (e.g. checkboxes, dropdowns, and images) and the custom fields offered by this plugin can support data of virtually unlimited size. For example, you could define a WYSIWYG custom field for your custom content type and it could hold many pages of data.
The architecture for this plugin was also inspired by MODX. WordPress is making progress as a viable content management system, but even after the thousands of lines of code in this plugin, it still does not support all the features in a system like MODx. WordPress templates are particularly limited by comparison. WordPress is great system for many scenarios, but if you're feeling that WordPress is starting to tear apart at the seams when it comes to custom content, it may be worth a look at another plugin or some of the other available systems.
Please see the Issues page for the most current list of on-going feature development.
If you are eager to see a particular feature implemented in a future release, please share your feedback at the official Issues page
And if you REALLY want some of these features implemented, you can hire me to complete portions of your project or make a donation. Many of the surges in development in this plugin were instigated by projects that required this plugin's use.
See also and References
- Attachments in Custom Post Types: http://xplus3.net/2010/08/08/archives-for-custom-post-types-in-wordpress/
- Taxonomies: http://net.tutsplus.com/tutorials/wordpress/introducing-wordpress-3-custom-taxonomies/
- Editing Attachments http://xplus3.net/2008/11/17/custom-thumbnails-wordpress-plugin/