echo used in wp_enqueue_scripts
-
This plugin is using echo within the wp_enqueue_scripts function in the code below found in the modules/enqueue/plus-generator.php file:
public function load_inline_script(){ $js_inline1 = 'var theplus_ajax_url = "'.admin_url("admin-ajax.php").'"; var theplus_ajax_post_url = "'.admin_url("admin-post.php").'"; var theplus_nonce = "'.wp_create_nonce("theplus-addons").'";'; echo wp_print_inline_script_tag($js_inline1); }
This is creating an issue with the default wp-sitemap.xml (as it’s being outputted there). The wp_enqueue_script function isn’t actually designed for echoing output to and should be for enqueuing scripts and styles.
In the code above the wp_print_inline_script_tag function is actually a filter, and likely added mistakenly instead of wp_add_inline_script.
Can this please be changed to follow the intended use of wp_enqueue_scripts to enqueue that inline script to help prevent issues with the echoing of that code prematurely?
- You must be logged in to reply to this topic.