Closed rubengc closed 6 years ago
Thank you @rubengc. I will put your suggestions here for easier reference:
I checked it and is loaded just on backend, changing the hook: add_action( 'admin_head', array( $plugin_admin, 'my_add_styles_admin' ) ); To: add_action( 'wp_head', array( $plugin_admin, 'my_add_styles_admin' ) ); And removing the check is_admin() fixes the issue
Also, is required to print the footer templates, so replacing the hook: add_action( 'admin_footer', array( $plugin_admin, 'wp_print_grider_tinymce_templates' ) ); To: add_action( 'wp_footer', array( $plugin_admin, 'wp_print_grider_tinymce_templates' ) ); Fixes it too
Regarding 2, the public facing script (gridable-scripts
only has jQuery as dependency).
The admin scripts are only needed when in an editor context, not on the frontend of your site. That is why they are binded to admin_head
and not wp_head
.
If someone would need editors in the frontend, some minor custom coding to also enqueue the scripts via wp_head
would do the trick. But this is not the common scenario and we would load things needlessly on the frontend for the majority of users.
Already explained on WordPress.org: https://wordpress.org/support/topic/fixing-some-errors-from-gridable/