WordPress.org

Ready to get started?Download WordPress

Forums

Featured images for post types without editor can't be used by other types (6 posts)

  1. Josh Leuze
    Member
    Posted 3 years ago #

    I found this issue on custom post types that have featured images enabled, but not the editor. Something like this:

    'supports' => array('title', 'thumbnail')

    If a featured image is added to one of those posts, it shows up in the media library and other post types can use it as a featured image, but it can't be added to the post. The "Insert into Post" button is missing when you browse to the image to add it.

    I ran into this problem with my own plugin Meteor Slides, but the issue isn't specific to my plugin, it can be reproduced with any custom post type.

    I used the example in the Codex to test it, and the problem was the same as with my plugin.

    Looks like WordPress is setup to remove the insert button when it can't be used due to lack of an editor, but it getting over zealous and doing this on all post types.

    Seems like a bug to me, I checked Trac and couldn't find a similar issue. Has anyone else run into this problem or are you able to reproduce it? I wanted to get some feedback before putting in a ticket.

  2. Josh Leuze
    Member
    Posted 3 years ago #

    I did some more testing and opened a ticket for this in Trac.

  3. maxxscho
    Member
    Posted 2 years ago #

    Hey,

    I have the same problem in a theme for a client I am working on. The button is only missing, if the custom post type DOES NOT SUPPORT 'editor' and if the image have been uploaded in this custom post as a featured image so it is attached to this custom post type.
    If you change 'supports' => array('title', 'thumbnail') to 'supports' => array('title', 'thumbnail', 'editor') you will see the "Insert Image" - Button.

    I have tested this in various themes with different code and the problem was always there. I think this is wordpress bug.

  4. Sam Scholfield
    Member
    Posted 2 years ago #

    I have also had this problem.

    Similarly, If you have a custom fields plugin that allows you to upload files or images, you won't be able to unless your custom post type supports 'editor'.

  5. Josh Leuze
    Member
    Posted 2 years ago #

    Good news, this bug has been fixed and the patch should be included in WordPress 3.3.

  6. maxxscho
    Member
    Posted 2 years ago #

    Yeah, great!

Topic Closed

This topic has been closed to new replies.

About this Topic