WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Tab Override] Javascript loaded on all admin pages (2 posts)

  1. scribu
    Member
    Posted 4 years ago #

    Hello,

    Since I post code snippets on my site, I find your plugin very useful.

    However, it's causing an error:

    document.getElementById("content") is null

    That is because it's loaded on all admin pages and it can't find the #content textarea.

    Can you make it so that it only loads on the post & page editing screens?

    It's just a matter of adding this code just after

    Just after this line:

    function to_doscript()
    {

    add:

    global $pagenow;
    if ( ! in_array($pagenow, array('post-new.php', 'post.php', 'page-new.php', 'page.php')) )
    	return;

    Thanks.

    PS: It would also be a good ideea to rename the to_doscript() function to something like tab_override_script() to prevent collisions.

    http://wordpress.org/extend/plugins/tab-override/

  2. scribu
    Member
    Posted 4 years ago #

    I see this is resolved in the new version. Nice.

Topic Closed

This topic has been closed to new replies.

About this Topic