New Plugin: CustomPress - Custom Post, Taxonomy and Field Manager

Hi guys,

I would like to present you CustomPress - Custom Post, Taxonomy and Field Manager ( new version: 1.0.5 - released ). This plugin allows you to add/edit/delete custom “post types”, “taxonomies” and “csutom fields”.

Description:
The purpose of this plugin is to give you the ability to convert your WordPress installation into a full blown CMS system through your back-end. The plugin serves the needs of both regular users and developers.

If you want to obtain a better understanding of the Custom Post Types and their power, you can go through this article on Codex.WordPress.org : http://codex.wordpress.org/Custom_Post_Types

If you want to obtain a better understanding of the Custom Taxonomies and their application you can go through this article on Codex.WordPress.org : http://codex.wordpress.org/Custom_Taxonomies

If you want to obtain a better understanding of the Custom Fields and their application you can go through this article on Codex.WordPress.org : http://codex.wordpress.org/Custom_Fields

All of the above is provided for you in this plugin. The plugin uses the entire WordPress internal API for the custom's which gives you absolute control over them.

Features:
1. Add/Edit/Delete/View Custom Post Types.
2. Add/Edit/Delete/View Custom Taxonomies.
3. Add/Edit/Delete/View Custom Fields.
4. Display/Organize Custom Post Types on Home page.
5. Create “single-[post_type].php” template for your post types.
6. Use the embed codes to customize your system.

Installation:
1. Extract the plugin archive file
2. Place the “custompress” folder inside you “wp-content/plugin” directory
3. Activate the plugin

Compatibility:
WordPress, WordPress MS ( 3.0.1 )

Changelog:
Version: 1.0.7
1. Bug fixes.

Version: 1.0.5
1. Bug fixes.

Version: 1.0.4
1. Bug fixes.

Version: 1.0.3
1. Improved UI
2. Internal architecture improved
3. Submodules added.
4. Localization added ( .pot files inside "cp-languages" and "ct-languages" ).
5. Embed codes added.
6. Bug fixes.

Release notes:
Due to the fact that the internal architecture of the current version is completly different from the previous one, the "v1.0.3" release is NOT backward compatible with the "v1.0.2" release.

Version: 1.0.2
1.Initial release

Guides:
This guide assumes you are using the latest version of the plugin.

Basic workflow:

1. Add a custom "Post Type":
1.1. Go to: CustomPress -> Content Types -> Post Types -> Add Post Type
1.2. Use the appropriate settings for your needs ( for most cases the default ones will do, you may want to change the "Labels" for your custom post type, so you can distinguish it from the rest )
1.3. You should see the newly created post type in your admin menu.
1.4 You can now add content, using your new post type. The new post type will have all the features of the regular post type plus more, depending on the settings you choose when adding it ( you can always edit the settings later ) .

2. Extend your new custom post type with a "Taxonomy". The purpose of the custom taxonomies is to give you the ability to organize your content in the best way you can think of.
2.1 Go to: CustomPress -> Content Types -> Taxonomies -> Add Taxonomy
2.2. Use the appropriate settings for your needs ( for most cases the default ones will do, you may want to change the "Labels" for your custom post type, so you can distinguish it from the rest ). One important setting is the "Hierarchical" option. Depending on the value of this option your taxonomy will behave like tag or like category.
2.3. Associate your custom taxonomy with the new post type you have previously created ( this is an option when you add/edit your custom taxonomy ).
2.4. You should see your new custom taxonomy below your custom post type.
2.5. You can add terms directly inside your post type ( recommended ) or inside the custom taxonomy admin page.
2.6. To display your custom taxonomies use the embed code associated with the particular taxonomy and place it in your "single.php" or "single-[post_type].php"( if you have it created from CustomPress->Settings") file.

3. Extend your new custom post type with "Custom Fields". This gives you the ability to add custom content to your post types.
3.1. Go to: CustomPress -> Content Types- > Custom Fields -> Add Custom Field
3.2. You can select different types of custom fields that can be associated with your custom post types ( textbox, textarea, dropdown, checkbox ... etc ).
3.3 To display your custom fields use the embed code associated with the particular custom field and place it in your "single.php" or "single-[post_type].php"( if you have it created from CustomPress->Settings") file.

4. Configure CustomPress:
4.1 Go to: CustomPress->Settings and select the check-boxes of the post types you want displayed on your Home page.
4.2. If you want to create a theme file for your custom post type ( If you have theme file for your custom post type you can customize it differently than the main post types. All post from this post types will use this template. In some cases you may find using the default theme file better.

Advanced Usage

The power of this plugin can be experienced in full by advanced users/plugin developers. So what can you do with it?

1. Extend available post types.
1.1. With this plugin you can extend available custom post types and add new features to them easily. Most of the plugins use custom post types for their content. Use CustomPress to extend their custom post types and add new taxonomies and custom fields.

2. Build your plugins on top of it.
2.1. The new architecture provides a submodule which handles only the Content Types and is loosely coupled with the rest of the plugin. The submodule resides in "cp-submodules" and is called "content-types". You can copy the content types submodule inside your own plugin and all content types will become part of it. The only thing you need to do is to include the "ct-loader.php" file from inside your plugin and setup the main menu slug of your plugin in "ct-config.php" so the UI can attach itself to it. You can use it in stealth mode also - activate the UI, add the necessary custom post types, custom taxonomies and custom fields and then deactivate the UI. All the custom content types will remain fully operational. Use the CustomPress plugin as skeleton for your plugins.

You can find the plugin attached. Please report bugs in the current thread.

  • Ivan
    • The Incredible Code Injector

    @Ovidiu:
    The plugin cannot control other plugins registered custom post types, taxonomies and fields. Plugins use http://codex.wordpress.org/Function_Reference/register_post_type register post type with literal values which we cant control. In contrast this plugin is build in a way which builds all the customs dynamically. We plan on releasing an API for other plug-ins to use and extend. Also this plugin is not intended to replace what you currently have but enhance it.

  • Ivan
    • The Incredible Code Injector

    @Ovidiu Detecting other plugins custom post types/ taxonomies is easy, changing and editing them is whole another matter. I will research the possibilities more and will see what me can do about that. Definitely it will be very handy if you can manage other plugins customs.

  • schnappaholic
    • New Recruit

    Ok, i have test the plugin under the scholar theme and buddypress wp 3.0.1 (not MS).

    Creating post type called “testing” works fine!

    Fist bug: When I create a taxonomie I get this in the post types box: Warning: invaild argument…! When I save the taxonomie and open again I can select a post type. (??)

    Second bug: I create a new page “test” and set the custom post type “testing” under the CustomPress Settings. When I open the page, I get the scholar homepage and not the custom post type posts! (??)

    any ideas?

  • Ivan
    • The Incredible Code Injector

    @saraswati1111 Yes currently there is no GUI for the custom fields and the taxonomies but for the next version there will be. For now you can integrate them in your template manually. Check the WordPress Codex for further assistance on the appropriate function calls with which you can do that.

    @schnappaholic Thank you for the bug report. I will investigate and will get back to you.

  • saraswati1111
    • Design Lord, Child of Thor

    I'm able to get the custom field generated on a normal post page but can't get it to show up on the custom post template that gets generated.

    I can't tell if some of the settings need to be changed or added in the custom post type settings page.

    This is a powerful plugin but needs some documentation for people who don't already have a very firm grasp on using custom post types, taxonomies, and custom fields.

  • saraswati1111
    • Design Lord, Child of Thor

    Sorry, i'm really confused. From what I can tell when the custom post type template get's created it just copies the single.php page and saves it as single-"yourposttype".php.

    I have set the custom field to be active on a normal post page, and the custom field information that is filled in gets shown on a post generated by a normal post page, however, when I follow all the same steps in a custom post type page (with a template with the exact same code) the information doesn't get shown on the page generated by the custom post type.

  • Ivan
    • The Incredible Code Injector

    @saraswati1111 With which function you are displaying the custom fields and where in the template you position it ?

    So basically you are saying that when you put the code for displaying the custom fields in single.php everything works and when you put it in single-[post_type].php it doesn't ?

  • saraswati1111
    • Design Lord, Child of Thor

    So basically you are saying that when you put the code for displaying the custom fields in single.php everything works and when you put it in single-[post_type].php it doesn't ?
    That's Correct

    Here's the code line's 22-27 of Twenty Ten default theme.

    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <div class="entry-meta">
    <?php twentyten_posted_on(); ?>
    <h2>Name:</h2> <?php echo get_post_meta($post->ID, "name", true); ?>

    </div><!-- .entry-meta -->

  • cbriere
    • Site Builder, Child of Zeus

    Hi,

    As saraswati1111 said:

    This is a powerful plugin but needs some documentation for people who don't already have a very firm grasp on using custom post types, taxonomies, and custom fields.

    I am one of those rookies. And the codex is very raw for non-programmers.

    2 questions:

    1-Is any tutorial on how to implement this?
    2-Can I use this plugin to create a database backend to add, edit, delete, display records?
    Please see the thread started here for an explanation of what I would like to do:

    https://premium.wpmudev.org/forums/topic/database-creation-plugin-to-develop-enter-create-display-data

    Will this plugin do the job?

    Thanks.

  • Ivan
    • The Incredible Code Injector

    @saraswati1111 Thanks, I will investigate and will get back to you.

    @xklubas

    When it will be compatible with buddypress?

    There are no specific tie-ins with BuddyPress, therefore everything should work.

    @cbriere

    1-Is any tutorial on how to implement this?

    The WP Codex provides the best documentation on how this plugin can be used. This is the GUI for the WP core custom post type, taxonomy and field API. The basic work-flow is: Add post type, add taxonomy, add custom field. Currently only the post types have a GUI for displaying them on the front. The taxonomies and the custom fields have to be implemented manually in your template ( not a rocket science, just two function calls ).

    2-Can I use this plugin to create a database backend to add, edit, delete, display records?

    I have checked the thread you are referring to and I think the plugin can help you achieve what you are looking for but I doubt that it will work out of the box for all of your requirements, therefor you can expect some additional coding to be required.

  • cbriere
    • Site Builder, Child of Zeus

    @ ivan
    Thanks for the info.

    So I decided to give a try to this plugin. But I think I am doing something wrong.

    After installing the plugin I created a page named "custom".

    Then in the control panel clicked on CustomPress under the CustomPress menu.
    Then under "select display post type on page:" I selected "custom".
    Then selected post, page, attachment.
    Then as per the instructions, it states:

    "Create theme file for: No custom post types available
    Your active theme folder permissions have to be set to 777 for this option to work. This will create "single-[post_type].php" file inside your theme.This file will be the custom template for your custom post type. You can then edit the file and customize it however you like. After you finish editing you can set your folder permission back to 755."

    So I set my active (Twenty Ten) theme folder to 777.

    Then I clicked on Save Changes.

    Then I checked my active (Twenty Ten) theme folder, but the "single-[post_type].php" file was not created inside my Twenty Ten theme folder. Just to be sure, refreshed the directory but still no new file was added. The only similar file on my theme is single.php.

    What I did wrong?

  • Ivan
    • The Incredible Code Injector

    @cbriere post, page and attachment post types are WordPress defaults and they use "single.php" and "page.php" respectively for their templates. If you define a custom post type, you can create "single-[post_type].php" file which will be the default template for this particular post type. The CustomPress settings give you the ability to create this template automatically. Hope that sheds some light on the usage.

    @gregfielding You can expect the next version, with all the bugs reported in the current thread resolved, very soon.

  • cbriere
    • Site Builder, Child of Zeus

    @Ivan thanks for the reply. However, the plugin is still not creating the "single-[post_type].php" file that will be used as the default template for post-type. I'm still studying the Codex.

    ... and looking for tutorials.

    So I found this tutorial regarding taxonomies, in which I have learned a lot, and thought it would be kind to share it with others.

  • cbriere
    • Site Builder, Child of Zeus

    For others having the same problem I posted on my second post on this thread on 10-20-10, the solution is simple: You will have to click on Add Post Type and create a post type. AFTER THAT return to the first menu of the plugin, choose the page on where the post type will be displayed, tick the Create Theme File For: and click on SAVE. Now the plugin will create "single-[post_type].php" file that will be used as the default template for your post-type. Then return to your theme directory and change atrributes from 777 to 755. Refresh and you will see your new "single-[post_type].php".

    Hope this helps others.

  • Ivan
    • The Incredible Code Injector

    @cbriere

    For others having the same problem I posted on my second post on this thread on 10-20-10, the solution is simple: You will have to click on Add Post Type and create a post type. AFTER THAT return to the first menu of the plugin, choose the page on where the post type will be displayed, tick the Create Theme File For: and click on SAVE. Now the plugin will create "single-[post_type].php" file that will be used as the default template for your post-type. Then return to your theme directory and change atrributes from 777 to 755. Refresh and you will see your new "single-[post_type].php".

    This is explained under the "Create theme file for" options inside CustomPress Settings.

    @cbriere

    Now I faced the same issue posted by schnappaholic on 10-15-10:
    "Warning: invalid argument supp…!"

    Yes, that is a bug with the current version. It is fixed in the 1.0.3 version which will be released shortly with couple of improvements.

  • gregfielding
    • The Incredible Code Injector

    Ivan,

    Quick question about displaying custom fields in posts...I've tried adding the following code to my template, but no luck. My field is Link Description, or "link-description"

    <?php get_post_meta($post_id, 'link-description', false); ?>

    I've tried a bunch of variations trying to get it to work. What is the right way to do it?

    Thanks!

  • gregfielding
    • The Incredible Code Injector

    Ivan,
    Error message with new version...

    Warning: include_once(/home/housings/public_html/wp-content/plugins/ct-admin-ui/ct-admin-ui-display-custom-fields.php) [function.include-once]: failed to open stream: No such file or directory in /home/housings/public_html/wp-content/plugins/custompress/cp-submodules/content-types/ct-core/ct-core.php on line 519

    Warning: include_once() [function.include]: Failed opening '/home/housings/public_html/wp-content/plugins/ct-admin-ui/ct-admin-ui-display-custom-fields.php' for inclusion (include_path='.:disappointed:usr/local/php5/lib/php:disappointed:home/housings/public_html/wp-content/plugins/buddystream') in /home/housings/public_html/wp-content/plugins/custompress/cp-submodules/content-types/ct-core/ct-core.php on line 519

    there is no "ct-admin-ui-display-custom-fields.php" in the download

  • Mason
    • DEV MAN’s Sidekick

    Hiya Greg,

    I think the custompress file needs to be put into the plugins folder on this. Just unzip and upload to plugins directory:
    plugins/custompress/cp-loader.php

    You can delete old plugin folder/files from previous version.

    Try it out and let us know! Thanks!

  • Ivan
    • The Incredible Code Injector

    @gregfielding I am looking at the path for the error and I don't see the "custompress" folder. You have all the files inside the extracted "custompress" folder right ? The current v1.0.3 is with 2 tweaks that might have caused your error. Please use it and report back.

  • gregfielding
    • The Incredible Code Injector

    Ok. The new tweaks fixed it.

    I'm still getting the "invalid argument" for the post-type field. If I click the warning text and hit the "add" button, the field/tax/type is added. Then, when I go back to edit it, the post types are there listed correctly. Weird, but the trick does work.

    Also, would it be possible to include a field to upload images?

  • Ivan
    • The Incredible Code Injector

    @kewalter

    Is it possible to use this to create different types per blog or per theme?

    You can achieve that with additional customization of the Content Types submodule. You can check which blog is displayed and based on that you can set the Public option, as for the theme, each post type can have custom theme template file.

  • Ivan
    • The Incredible Code Injector

    Version: 1.0.4 - Released!

    @gregfielding The "v1.0.4" version release fixes 2 of the bugs you have reported. The foreach and in_array bugs. I haven't been able to reproduce the "Add Another Option" not working bug. This should be JS related bug. Can you supply more info about the setup you are using: WP Version, SS/MS, PHP Version, MySQL version, Browser and Version. Also can you take a look at the PATH which loads the JS on the "Add Custom Fields" page. It should read something like: http://wordpress.com/wp-content/plugins/custompress/cp-submodules/content-types/ct-admin-ui/js/ct-admin-ui-scripts.js?ver=3.0.1 . Can you also test few constants for me. Put thees at the bottom of "ct-loader.php" which is located inside "cp-submodules" folder and report back the result.

    echo WP_PLUGIN_URL . '<br />';
    echo WP_PLUGIN_DIR . '<br />';
    echo CP_PLUGIN_URL . '<br />';
    echo CP_PLUGIN_DIR . '<br />';
    echo CT_SUBMODULE_URL . '<br />';
    echo CT_SUBMODULE_DIR . '<br />';
  • Ivan
    • The Incredible Code Injector

    @schnappaholic

    V1.0.4 post types = I can't display the post type in the nav menü (template, ...). It is only possible to display the post type on "home".

    The query_posts() WordPress core function introduces number of bugs when used on pages and in the specific conditions we were using it, most notably reseting the "is_home()" conditional function and breaking a lot of stuff subsequently. For the time being this features is disabled as part of the CustomPress plugin. Fear not however. You can achieve the same result with a little bit of manual coding.

    1. Create a page template file: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    2. Place the following function call ( substituting the "your_post_type" with the system name of your post type ) just before your page template "Loop" start ( if ( have_posts() ) ... ) :
    <?php query_posts( array( 'post_type' => array('your_post_type') ) ); ?>

    3. Place the following function call just after the "Loop" end ( endwhile; ... ):
    <?php wp_reset_query(); ?>

    4. Create a Page from inside the "Pages" admin menu and assign the custom page template you've just created to it from the "Page Attributes" inside the "Add Page" screen.

    5. If you have completed everything correctly you should see all of the Posts from your custom post type associated with this page on the page URL slug.

    V1.0.4 taxonomies = I can't select a post type. The post type is fixed --> "post".

    I can't reproduce this bug. Can you provide more info. For example does the same thing happen inside the Add Custom Field "Post Types" box ( they use the same function call to display available post types ) ? When you click edit on that taxonomy do you see all the post types or just "post" ? System setup info will also be appreciated.

  • CPS
    • WPMU DEV Initiate

    Hello Ivan,

    I went through your tutorial on the CustomPress plugin and copied your sample fields and methods, but cannot get the custom fields or taxonomies to show up within the content page at all.

    So, based on the sample in the tutorial, I cannot see the Year the book was published, nor can I actually "tag" the book with one of two genres I created.

    Thanks for your help in advance.

  • Mason
    • DEV MAN’s Sidekick

    Hiya and welcome webbistro and CPS to WPMU DEV!

    Glad you're checking out our new CustomPress plugin. It's pretty awesome :smiley:

    @CPS Did you check the boxes under CustomPress>Settings for "Create theme file"?
    Once you've done that, you'll have to correctly place the embed code into this new theme file (via code editor or built in wordpress theme-editor).

    Also, If you can't tag a book (there's no spot for 'genre' on the post) you'll need to double-check that you correctly selected all the post types you want it to be available for on the edit 'genre' taxonomy page.

    Thanks!

  • CPS
    • WPMU DEV Initiate

    @Mason

    Thanks for the welcome. (HA!)

    I definitely checked the box for "create theme file" and edited the file with the correct embed codes in the correct locations. I'm really not sure why they didn't show up.

  • Mason
    • DEV MAN’s Sidekick

    @CPS

    Ivan will be along in a few hours and he should be able to look into this as well. I'm kinda stumped as it's working on my install. You don't have a capital letter in your slug per chance do you? We had a bug early on that would cause a capital in the slug which doesn't work on every server setup.

    To test, add some text to your custom template file and see if it shows on your custom post page. If it does, we know it's using that template, if it does not, then it's probably not using the page template and may be something we need to look at.

    Thanks!

  • sbernado
    • Design Lord, Child of Thor

    This is so exciting.

    Is it possible, or will it be possible, to export the settings of the custom post types we have prepared so that we may use them on another website without having to manually configure everything again?

    As a theme designer, this would be a beautiful thing to be able to prepare my own Custom Post Types and then include them with my packaged themes.

    Thank you for all your great work!!!

    - Scott

  • Ivan
    • The Incredible Code Injector

    @webbistro

    Ivan, what about custom fields image type? Image, video, audio?

    The default WordPress media manager can handle all of that but I will think about implementing this in a subsequent release.

    @CPS
    Do you see the custom post type content at all ? If not go to Settings-> Permalinks and resave your permalink structure.

    @sbernado

    Is it possible, or will it be possible, to export the settings of the custom post types we have prepared so that we may use them on another website without having to manually configure everything again?

    As a theme designer, this would be a beautiful thing to be able to prepare my own Custom Post Types and then include them with my packaged themes.

    Yes definitely. This is a must have feature and it will be implemented in the next release.

  • CPS
    • WPMU DEV Initiate

    @Ivan

    I actually just managed to get it working! Apparently I accidentally missed a closing bracket while copying over the code, and didn't notice because I was working in the Theme Editor. That's what I get for using the Theme Editor!

    Thanks for your help, but again I must ask, is this plugin compatible with the Genesis Framework at all?

  • CPS
    • WPMU DEV Initiate

    @Ivan

    I ask because when I generate a template using CustomPress and try to edit it, I get the standard Genesis:

    /**
    * WARNING: This file is part of the core Genesis framework. DO NOT edit
    * this file under any circumstances. Please do all modifications
    * in the form of a child theme.
    *
    * This file handles posts, but only exists for the sake of
    * child theme forward compatibility.
    */

    There really is no place to edit or add the embedded code. I know this is a bit beyond what your support team offers, but I hope you can help! Thanks!

  • Ivan
    • The Incredible Code Injector

    @CPS

    Can you send me the whole theme package you are using so I can take a look at it and tell you the particular modifications you need to do to get it working. Use the contact form with "Forward to: Ivan"

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.