Do not echo in add_leadin_frontend_scripts
-
Hi,
Your plugin breaks the WP REST API responses, because in /inc/class-leadin.php you are printing the following:
echo '<!-- HubSpot WordPress Plugin v' . LEADIN_PLUGIN_VERSION . ': embed JS disabled as a portalId has not yet been configured -->';Please remove that line, because it’s printed in every rest response and we get
SyntaxError: Unexpected token < in JSON at position 0 SyntaxError: Unexpected token < in JSON at position 0, because that line is printed before the json.It’s not a good idea to print something, when using
wp_enqueue_scriptshook.Please use any other hook like
wp_add_inline_styleoradmin_head.Regards,
Stanimir
The topic ‘Do not echo in add_leadin_frontend_scripts’ is closed to new replies.