Easy Blogging does not let me add media

Hi..

Easy Blogging does not let me add media when I use a custom post type.

I can easily add media in Posts and Pages, but not in my custom post type, Portfolio.

When I press the button at the top: ADD MEDIA, nothing happens (in custom post type), except that I get a # at the end of my url.

Like this: http://test.plusfolio.com/wp-admin/post-new.php?post_type=portfolio#

It works fine with the regular post types, but how to I make it work with custom post type.?

Thank you in advance.

  • Jack Kitterhing
    • Code Norris

    Hi there @hjalde

    I hope you are well today.

    Sorry for the delay.

    Could you send me the following details so I can login and take a look :slight_smile:

    – Mark to my attention

    – Link back to this thread

    – Include admin/network access

    – Include FTP & cPanel (where possible).

    – Include any relevant URLS for your site

    https://premium.wpmudev.org/contact/

    Thank you for being a WPMU DEV member and have a great weekend!

    Kind Regards

    Jack.

  • Hjalde Markvad
    • Flash Drive

    Hi..

    Sorry for the delay..

    But I have found out what was wrong.

    I have built a plugin which among others has to ensure that the end user must select a taxonomy.

    Here’s the code:

    /** Require portfolio type */
    add_action('admin_footer-post.php', 'hm_require_taxonomy');
    add_action('admin_footer-post-new.php', 'hm_require_taxonomy');

    function hm_require_taxonomy(){
    if( is_admin() && get_post_type() == 'portfolio' ) {
    echo "<script>
    jQuery(function($){
    $('#publish, #save-post').click(function(e){
    if($('#taxonomy-portfolio_type input:checked').length==0){
    alert('Oops, please select a portfolio type before you publish.');
    e.stopImmediatePropagation();
    return false;
    }else{
    return true;
    }
    });
    var publish_click_events = $('#publish').data('events')['click'];
    if(publish_click_events){
    if(publish_click_events.length>1){
    publish_click_events.unshift(publish_click_events.pop());
    }
    }
    var save_click_events = $('#save-post').data('events')['click'];
    if(save_click_events){
    if(save_click_events.length>1){
    save_click_events.unshift(save_click_events.pop());
    }
    }
    });
    </script>";
    }
    }

    It would be sweet if both things worked together.

    Do you have any idea how this can be done ..?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.