Support » Plugins » [Plugin: Advertising Manager] JS added to admin pages of other plugins

  • Hello, I’ve been approached by a user of my plugin – Tweet Blender – stating that there is an error on the admin setting page: document.getElementById("ed_toolbar") is null

    This error is caused by the following javascript generated by your plugin document.getElementById("ed_toolbar").insertBefore(ed_advman, document.getElementById("ed_spell")); and the error is generated because my admin page does not have an HTML element with id ed_toolbar

    Please do one (or both) of the following:
    1) Modify your JavaScript so it checks for presence of the element with id=ed_toolbar and only then calls insertBefore()

    2) Modify Admin.php on line 28 and instead of blindly adding your javascript to the footer of every admin page check to make sure it’s your admin page that’s being viewed. Something like this will do:

    if ($_GET['page'] == 'advman-settings' || $_GET['page'] == 'advman-manage' || $_GET['page'] == 'advman-create') {
      add_action('admin_footer', array('Advman_Admin','display_editor'));

    Hope this helps. Please patch your code so our plugins play nice together.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Advertising Manager] JS added to admin pages of other plugins’ is closed to new replies.