Support » Plugin: Code Snippets » js script for non admin

  • hi there,

    I have a js that i’d like to make it work for non-admins only.

    would the written snippets is correct?

    if ( ! is_admin() )

    {
    add_action( ‘wp_footer’, function () { ?>
    <script>

    /* JavaScript code here */

    </script>
    }
    else return;

  • The topic ‘js script for non admin’ is closed to new replies.