mondula / ticket-hub

1 stars 0 forks source link

WP_Feedback_Use wp_enqueue commands #13

Closed JonathanPultz closed 2 months ago

JonathanPultz commented 2 months ago

Your plugin is not correctly including JS and/or CSS. You should be using the built in functions for this:

When including JavaScript code you can use: wp_register_script() and wp_enqueue_script() to add JavaScript code from a file. wp_add_inline_script() to add inline JavaScript code to previous declared scripts.

When including CSS you can use: wp_register_style() and wp_enqueue_style() to add CSS from a file. wp_add_inline_style() to add inline CSS to previously declared CSS.

Note that as of WordPress 5.7, you can pass attributes like async, nonce, and type by using new functions and filters: https://make.wordpress.org/core/2021/02/23/introducing-script-attributes-related-functions-in-wordpress-5-7/

If you're trying to enqueue on the admin pages you'll want to use the admin enqueues.

https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/ https://developer.wordpress.org/reference/hooks/admin_print_scripts/ https://developer.wordpress.org/reference/hooks/admin_print_styles/

Example(s) from your plugin:

ticket-hub/shortcodes/th-ticket-sc.php:84