• Since I created my plugin, I see that the “Add Media” button does not load at all. However, when I comment the “shutdown” action, it works.

    I created a plugin, it’s basically just two custom post types with a few abilities added to them (https://lespointscom.com/a/misc/tcaan/tcaan_members.zip).

    However, I noticed that the “shutdown” action, even without anything in it, creates a BUG :
    add_action("shutdown", "tcaan_members_debug");

    I made sure to empty the “tcaan_members_debug” function like so :

    `function tcaan_members_debug()
    {
    /*
    if(!(isset($_GET[“post”]) && isset($_GET[“action”])))
    {
    global $TCAAN_Members;
    if(get_option(“tcaan_show_debug”) == 1)
    {
    $TCAAN_Members->tcaan_debug();
    }
    else{}
    }
    */
    }
    `

    Still, the bug persisted with the same “infinite” loading.
    It was only when I decided to comment the add_action itself, that I noticed everything was working fine :

    //add_action("shutdown", "tcaan_members_debug");

    That seems to mean that “shutdown” does not work at all for wordpress 4.1.1 at least.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I just downloaded your plugin and the ‘Add Media’ button in each post or page is working fine on my end. Or do you mean some other ‘Add Media’ button?

    Btw, I’ve uncommented function hooking to the shutdown action hook in your plugin so I could test it.

    I also had this issue. When I entered Media in dashboard I got “infinite” loading. The source of it was my plugin that i developed. I found out that my plugin also load in a page ‘admin-ajax.php’ and that was the reason.
    When I stop my plugin from load in this page using the next code:

    global $pagenow;
    $excludePages = array(
     'admin-ajax.php',
    );
    if ( !in_array($pagenow, $excludePages) ) {
    	[load my plugin]
    } else {
    	[only load my admin menu link]
    }

    and after that the “infinite” loading has stoped.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘The Add Media button loads forever with my plugin (add_action "shutdown")’ is closed to new replies.