While I don’t think anyone can solve the source of the issue without poking around the codebase, I think the (untested) code below may solve the impact.
Use output buffering to store the <script>
, and then remove all the new lines and extra whitespace (tabs, line breaks, multiple spaces).
function i13woo_extra_checkout_fields() {
ob_start();
?>
<script>
...
</script>
<?php
$script = ob_get_return();
$script = str_replace( array( PHP_EOL, “\t”, ' ' ), '', $script );
echo $script;
}
Related Posts:
- Mega Menu Walker
- How to add a class to the attachment images
- How to call a function only once (global variable scope)
- Multiple is_page() in page.php
- Fatal error: Call to undefined function plugin_dir_path()
- Switching wp_get_sites to get_sites
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- How to correct schedule my event weekly with wp_schedule_event()
- Execute a shortcode when clicking on a image
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- How can update custom meta for all posts
- Is $hook a global variable in WordPress
- Change logo based on incoming domain
- wrong php date()?
- How do I fetch all comments per post via WP REST API?
- Shortcode content output but not in correct place
- How do I display a user’s previous orders as a select box option on a product?
- Handling Body class based on Template
- Remove meta description on certain pages
- Image media upload metabox
- How to combine wordpress_logged_in cookies in one cookie?
- Two Different Links for Same Product – WooCommerce [closed]
- Automatically adding new post categories to menu
- Get post id in a function when edit/add a post
- Woocommerce related product text
- esc_html_e() is not translating string in wordpress [closed]
- get author_name from queried post
- Pass php dynamic variable to shortcode
- Limit 1 global comment per minute
- Modify custom field input data before creating a new post
- Query Pages and post excerpts dynamically
- Is there a way to conditionally check whether a WordPress post title is empty?
- Echo a function inside a function
- Use WordPress function in php file
- Get my site session in wordpress?
- is_user_logged_in() not working in AJAX validation call
- Register a menu – Error Header
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- How to create a field in customize and show that in header.php?
- Set site title & tagline with wp.config or function.php
- Shortcode to embed Edit Account form not working
- How to make jquery count down timer function manually editable
- Hierarchical taxonomy list with modificated term links
- Enqueing External JS on the remote server JS
- iframe not showing in content on blog page
- Get user custom field value on function.php
- entire JS folder not loading in a WP theme
- Get the name of menu item with wp_nav_menu
- Else/If Statement to Display Photo Descriptions
- PHP Output also in Child theme, but different
- Dynamically Generate Functions and Hooks
- Strip from or something better?
- Customize field names in backend profile edit page through function.php [duplicate]
- Time Delay a URL Redirect for Specific Page
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Need help for some PHP code
- Adding HTML Code to Replace Text in PHP
- how to replace h1 entry title with h2 in category pages only
- How to unset a function from a action inside a class, that is called in another class
- Create a new account on site B with data from the purchase of site A
- Why is the current page loaded in the pop-up window and not the specified one?
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Wp_Schedule_Event every few minutes doesn’t work
- File from parent theme imported to child theme doesn’t work – any ideas?
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- register_block_type is not working properly
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- cURL needing to loop through all “next_page”
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- post_exists stops working in a scheduled event
- How to center all text body in single.php at once?
- Access WP files on “server 1”, from “server 2” – using wp-load on an external website
- Where do I implement this display of User Meta Data, and how to put it in a table?
- How can I get my pagination loop to display the correct number of total pages?
- Get posts by id using shortcode
- Is it possible to replace ‘attachment’ with another word?
- Show post/page into div using function
- PHP get_category() function redeclared
- How to trim content AND retain HTML?
- Display posts using post ID’s in an array
- Issue encountered while trying to keep website private
- Popular Post Not Show
- How to make 2 similar functions more efficient
- wp_delete_comment is doing nothing
- Custom meta box save values issues – Deprecated: Function ereg() and more
- WordPress – registering sidebar and adding a button directly after .textwidget
- Ninja Forms – pull in some post related information
- Functions are causing errors
- WordPress adding in site URL to header links
- Adding code to the function file
- Error on Include php:/usr/share/pear
- I am trying to replace a string with other from function.php
- Link to external page has wordpress blog-url inside
- Appending an ACF custom field to the page title
- Need help with Deprecated: Non-static error when update PHP 7.4 -> 8.1 with Dyad 2 theme
- posts_clauses drop ACF get_field function
- Show div only if product has attribute
- Is there a hook that I can use when a fatal error occurs?