Support » Plugin: Custom Login » Media doesn't attach to custom post type posts

  • Resolved Mike


    Hey! My friend Alex Woolfson uses this plugin, as well as one I developed. My plugin relies heavily on custom post types and the media attached to them, but Alex noticed that – while BM Custom Login is active – media uploaded on the Add/Edit Post screen for my plugin’s custom post type posts weren’t actually attaching.

    I wanted to rule out my plugin as the culprit (as it very well could’ve been) so I did a quick test on my dev box with just BM Custom Login and a dummy plugin that only registers a custom post type:

    function dummy_post () {
    	register_post_type('dummy_post', array(
    		'public' => true
    add_action('init', 'dummy_post');

    Even with just these two plugins active images don’t properly attach to the custom post type posts when uploaded. After some poking around it looks like the issue may be with the enqueue_color_picker() function: it’s calling wp_enqueue_media() everywhere, which is preventing media from properly attaching to custom post type posts. I did a pull request on GitHub with a proposed fix.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Mike


    Ha ha, oops; I see that the GitHub repo is just a mirror. Sorry about that! You can still see the proposed fix there, though. Hope this helps!

    Plugin Author binarymoon


    Hi Mike – thanks a lot for the report and code. I’ve merged it in and will publish it shortly!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Media doesn't attach to custom post type posts’ is closed to new replies.