Support » Networking WordPress » Multisite javascript – where's the right place?

  • Where is the right place to install JavaScript to affect all sites on a multisite setup? Based on other docs I read, you’re supposed to put JavaScript into wp-content/themes/name-of-your-theme/*.js and reference it from functions.php. But this is bad for several reasons:

    • It affects only 1 theme, and in multisite, there may be many themes active.
    • Updating the theme may overwrite the functions.php file, losing your changes.

    So what is the right approach? Some examples of what I’m trying to do with JavaScript:

    • On wp-admin/post-new.php, require the new post to have a non-blank title
    • Add and hide some gadgets on wp-admin/user-new.php

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multisite javascript – where's the right place?’ is closed to new replies.