Forums

how to enqueue postbox.js (2 posts)

  1. neonWired
    Member
    Posted 1 year ago #

    Can't seem to enqueue wp-admin/js/postbox.js to use with my plugin. What's the correct way to do it?

  2. Rebecca Mastey
    Member
    Posted 1 year ago #

    function add_the_script() {
       wp_enqueue_script('postbox');
    }
    
    add_action('init', 'add_the_script');

    Is that what you tried? If you're trying to load it in the admin panel, try admin_init or admin_print_scripts. (Never enqueued in the admin panel, so just a guess there.)

Topic Closed

This topic has been closed to new replies.

About this Topic