WordPress.org

Forums

Add js file to all wordpress admin pages with plugin (2 posts)

  1. Dave Redfern
    Member
    Posted 5 years ago #

    Hello,

    I want to write a small plugin to add a js file to all admin pages. I have read how to add it to the actual plugin page but not everywhere.

    How do i do this?

    thanks.

    Dave.

  2. Jeremy Clark
    Moderator
    Posted 5 years ago #

    function plugin_admin_head_js() {
    print "<script type='text/javascript' src='linktoyourjs.js'></script>";
    }
    add_action('admin_head', 'plugin_admin_head_js');

Topic Closed

This topic has been closed to new replies.

About this Topic