• I have a plugin which uses the media library for inserting images using wp_enqueue_media.

    At this moment when this plugin is active, the featured images functionality breaks. If found that this was an existing bug was fixed in 2.5 but for me it still occurs.

    Anybody any thoughts on this? Is there any way to prevent this? I built in a check but isn’t working (tried a few variations) :

    if ( did_action( 'wp_enqueue_media' ) === 0 )
    	 wp_enqueue_media();
Viewing 6 replies - 1 through 6 (of 6 total)
  • What hook are you using for the function which contains the snippet above?

    Thread Starter Bas Schuiling

    (@basszje)

    Not exactly a hook, but it’s in a plugin. Basically this:

    In __construct
    add_action('admin_init',array($this,'init') );

    In init
    wp_enqueue_media();

    Right now I fixed it by doing:

    global $pagenow;
    	if ($pagenow != 'post.php' && $pagenow != 'post-new.php')
    	{	wp_enqueue_media();
    
    	}

    But it’s not a very nice solution of course.

    Use pastebin.com and let me see the entire contents of your file. If you don’t mind, of course.

    Thread Starter Bas Schuiling

    (@basszje)

    SVN

    Or if you want to whole plugin here: Simple Category Icons 🙂

    Thanks!

    Okay.. I’ve been looking through your code, getting an idea of how things work.

    I’m assuming this replaces the little ‘folder’ icon when viewing categories. If that is correct, it’s actually not replacing the icons on my theme on my test site.

    I went through and assigned the icon to the category (which I can confirm from the little icon in the “Icon” column of the categories page).

    However, it doesn’t seem to replace the generic folder icon on the front-end of the site.

    I’m not sure if this is related or not.. but thought I should mention.

    I have to run to class. I’ll be back in a few hours, and will get back with you then!

    Good luck until then 🙂

    Thread Starter Bas Schuiling

    (@basszje)

    Folder icon? No the idea is you can get icons in your theme based on terms of the post ( look at the_icon and get_the_icon functions 😉 )

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Wp_enqueue_media bug still occuring?’ is closed to new replies.