Hi,
I am not ignoring you. I have gone through your each and every response, I have checked in code, read codex as well. Everything looks OK.
As I have told you, there are two functions for script and style,
1) wp_register_style() and wp_register_script()
2) wp_enqueue_style() and wp_enqueue_script()
Now when we use wp_register_style() OR wp_register_script() then it is highly recommended to use within proper hook wp_enqueue_scripts() OR admin_enqueue_scripts() based on your requirement.
Without this hook you can not register your script or style. If you do then it will be a bad practice.
Now in our code we have registered our script with wp_enqueue_scripts() hook now we can use that script handle where we want so that’s why we just enqueue our script with handler in shortcode. It will only be used when page has a shortcode. On other pages it will not come due to speed concern, code optimization and to avoid conflict.
As per HTML standard style should be load in HEAD and script should be in footer. Our plugin also follows this.
Now let me show you some WordPress core example,
1) File Location : /wordpress/wp-admin/about.php – Line no 12. They have enqueued wp_enqueue_script( ‘underscore’ );
2) File Location : /wordpress/wp-admin/comment.php – Line no 60. They have enqueued wp_enqueue_script( ‘comment’ );
My environment is as below,
1) WordPress – 5.1.1
2) WP_DEBUG set to true in config.php file
3) PHP – 7.2.4
I have checked my PHP error log also but not found this type of error.
Can you please tell me what is your environment and please provide me the full screenshot of that error.
Please check by disabling the other plugins also.