Comment out that <script>...</script> part and see if you get the error. It looks like you are printing javascript from a call to add_sub_menu(). I’m not sure that will work. That function isn’t really intended, as far as I understand it, to be echoing html/css/javascript.
Usually I would wp_enqueue my scripts rather than print them like that or print it from within a function– usually my own– that is printing markup.
Thread Starter
Rhand
(@rhand)
Thanks for the feedback. The script needed to work with the postboxes were not loaded properly because I did not call the proper action for it nor did I do the call on time. Now reworking the code..
I moved my <script> code to the wp-footer action and now i don’t get the error, but my boxes don’t open/close when i click them. How can i get boxes to toggle open & closed when i click the title?