0

I am trying to create in admin area my own Dashboard for my plugin. Only article I found is an example in WP Developer Resources but the widgets cannot be moved. I suspect that loading script code in this article is incorrect:

    wp_enqueue_script( 'dashboard' );
    wp_admin_css( 'dashboard' );
    add_thickbox();

Shouldn't there be a path to the script? But where to find it? Thank you for the advice.

1 Answer 1

1

The first parameter to wp_enqueue_script()—in this case, dashboard—is the handle of the script. The handle can be pre-registered using wp_register_script(), and that's where the script's path will be set.

dashboard isn't one of the default scripts that WordPress registers, but it's entirely possible some other entity has registered it.

Looking at the example code that you're working from, you can't just snip the three lines in your question out and use them in your code. You'd need to take the entire sample provided and modify it to suit your purposes.

1
  • 1
    Of course I used wp_register_script() and as I wrote the code from the example works, it's just obvious that it's not getting the jscript. I didn't want to paste the code from the whole example here.
    – Vlado
    Commented Oct 27, 2023 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.