WordPress.org

Ready to get started?Download WordPress

Forums

Edit Flow
[resolved] Support for Custom Post Types (16 posts)

  1. sriz
    Member
    Posted 3 years ago #

    How to make it work with Custom Post Types ?

    I noticed in a thread (made 10 months ago) that there would be support for CPTs soon.

    Is it available yet?

    Thanks

    http://wordpress.org/extend/plugins/edit-flow/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    Yes, custom post type support is documented in "Other Notes". You'll want to add the relevant snippets into your theme's functions.php file.

    In Edit Flow v0.7, we'll be added an interface for managing which features are available for which custom post types in the admin.

    Let us know if you have any specific questions about the implementation.

  3. sriz
    Member
    Posted 3 years ago #

    Thanks for quick reply.

    Awesome. It worked great.

  4. Radina Matic
    Member
    Posted 3 years ago #

    I apologize for this basic question, but PHP is not my strong suit and I have never edited the functions.php file before.

    Where exactly is the "init hook"? I made a child theme from Yoko theme but I can not figure out where to put the "register_post_type" or "add_post_type_support" in this child functions.php file. Tried various options and googled around to no avail... :(
    Can somebody please help me with this?

    Thanks in advance.
    DD

  5. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    @DD666 You can modify the following snippet to your needs:

    function db_add_ef_post_type_support() {
    add_post_type_support('your_custom_post_type_name', 'ef_functionality');
    }
    add_action('init, 'db_add_ef_post_type_support');

    You can include add_post_type_support() as many times as you need with the function.

    Alternatively, you can wait a couple of weeks for the v0.7 release and you'll be able to configure this from the admin.

    Hope this helps,

    Daniel

  6. Radina Matic
    Member
    Posted 3 years ago #

    Thanks Daniel, it's working now and I have learnt one more thing today... ;)

    Looking forward to see the new release!

    Cheers,
    DD

  7. kalee-eversole
    Member
    Posted 3 years ago #

    I just tried to add and modify this code you provided in my functions.php file, (and I am also quite lousy with PHP) and it keeps coming up in my file as if I am adding it in between the wrong tags,( which I might be) ...basically I am just lost as to where to add it in the file and what parts actually need modifying? I'm pretty bad at this, but any extra help would be awesome.

  8. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    @kalee-eversole Can you post here what you've added?

  9. kalee-eversole
    Member
    Posted 3 years ago #

    Sure. Here is my entire functions.php file - I threw the code you provided above towards the bottom. I'm just not sure where to put it so it makes sense with the other pieces of code or if I'm modifying it right. Thank you so much for your quick response by the way! :)

    [Code moderated as per the Forum Rules. Please use the pastebin]

  10. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    I see what happened :) Instead of:

    function db_add_ef_post_type_support() {
    add_post_type_support('Patterns', 'ef_functionality');
    }
    add_action('init, 'db_add_ef_post_type_support');

    You'll want to explicitly name the post functionality you want to add, like so:

    function db_add_ef_post_type_support() {
    add_post_type_support('Patterns', 'ef_notifications');
    add_post_type_support('Patterns', 'ef_custom_statuses');
    }
    add_action('init, 'db_add_ef_post_type_support');

    You'll obviously want to include the functionality you actually want.

    Hope this helps,

    Daniel

  11. kalee-eversole
    Member
    Posted 3 years ago #

    Thanks Daniel. I just tried using the code above, but I'm still having the same issue. I guess my snag here is that once I add the add_action('init, 'db_add_ef_post_type_support');, after the initial code snippet above my closing php tag ( ?> ) tag changes from red to orange, (I'm using Coda) which renders the code broken. I apologize if there is something obvious here I am not recognizing haha, I truly appreciate the help though!

    Kalee

  12. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    @kalee-eversole What error do you get?

  13. kalee-eversole
    Member
    Posted 3 years ago #

    After saving the functions file with the entire snippet you gave me, I get a HTTP Error 500/Server error when I refresh my site. And the code in the file acts like I've placed the snippet somewhere without closing a tag, however I hadn't been in or modified the functions file until today.

    Here is a link to a screenshot that shows you the code I have: http://img17.imageshack.us/img17/4536/screenshot20111115at400.png

    Thanks again,

    Kalee

  14. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    My bad. I missed a quotation mark in my snippet. Try this instead:

    function db_add_ef_post_type_support() {
    add_post_type_support('Patterns', 'ef_notifications');
    add_post_type_support('Patterns', 'ef_custom_statuses');
    }
    add_action('init', 'db_add_ef_post_type_support');

    (The 'init' code was missing a quotation mark...)

    Hope this helps,

    Daniel

  15. kalee-eversole
    Member
    Posted 3 years ago #

    Oh great! That worked like a charm, I didn't even notice the missing quotation! Thank you so much!

    One little though though - when I click on 'Pending Review' (or any other status, custom or not) on the Posts at a Glance widget in the dashboard, it shows 3 total Pending Review posts ( 2 from Posts tab and 1 from my CPT Patterns tab) but it will only take me to the Pending Review entries for Posts and will not display my custom post type Patterns Pending Review posts. I don't know if this is a bug or something I haven't configured correctly. Everything else seems to be working fine now, though.

    Thank you again for all of your help!

    Kalee

  16. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    One little though though - when I click on 'Pending Review' (or any other status, custom or not) on the Posts at a Glance widget in the dashboard, it shows 3 total Pending Review posts ( 2 from Posts tab and 1 from my CPT Patterns tab) but it will only take me to the Pending Review entries for Posts and will not display my custom post type Patterns Pending Review posts. I don't know if this is a bug or something I haven't configured correctly. Everything else seems to be working fine now, though.

    This is a known bug we hope to have resolved in an upcoming release.

    Thanks,

    Daniel

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic