Problem solved, I replaced all function calls that return HTML with :
ob_start();
myFunctionDisplayHTML();
return ob_get_clean();
And the JSON response is valid.
Thanks @phatskat, you got me on the right way 🙂
Solution find here
Related Posts:
- WPGut – Updating failed and shortcode?
- Execution limit and Memory limit errors even i changed to 1024M and 600(cache.php,load.php)?
- Are block templates incompatible with serialize_blocks?
- Gutenberg Block showing invalid content on edit
- How to access noticeOperations from withNotices
- WP Gutenberg Blocks – How to limit first/root blocks
- How to get boolean value from register_meta properly?
- wp_nonce_field displaying twice
- How to only load css for used blocks on frontend
- Invalid hook call on save, not edit when using swiper slider
- Proper way to use useSelect
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Pass custom props to
- How can we stop showing short code in create or edit post section
- How do I make two shortcode use the same id and increment it when I use them multiple times?
- Caption Shortcode: what filter to change the image size?
- Gutenberg text field validation
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- Remove Gutenberg Buttons Block
- useBlockProps() nests wrapper with class name inside block wrapper in the editor
- User set default settings for a Block in Site Editor
- WordPress Block with Interactivity API e Preact Component
- Rerender core Templates with with ToggleControl but it doesnt recognize block type
- Gutenberg – Call google map render function in save after DOM has been rendered
- GET request return value as error instead of success
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Impossible to declare box-shadow with wp.customize?
- Gutenberg block breaks when showing new data
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- How to write a custom shortcode name book?
- What happens/fires when you select a block in the editor?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Is “document loaded” different on admin side than public side?
- How to re-render inspector controls?
- Override category archive page title (not the head title)
- How to use setAttributes outside of the edit function return
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- How do I add filter with woocommerce categories?
- Where do I hook to have the server do something in PHP on block attribute change?
- By adding “?login – failed” code unable to access my dashboard
- Reading plugin settings in esnext wordpress block
- How can I pass WP_Query results to a plugin?
- Can’t upload image via submitting custom post from frontend
- Need Help to make a logic for editing posts in Frontend
- Redirection from a specific page for users logged in but not with membership
- Get value of custom checkbox from Gutenberg sidebar in plugin
- I have a random letter appearing before my content. Where to start looking for the cause?
- Metabox types list
- Is it possible to develop themes and plugins locally while still allowing content to be updated directly in the admin dashboard?
- Where to save Gutenberg plugin data?
- WP_Fatal_Error_Handler OR WP_Error OR try/catch
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Rate limiting ajax requests in WordPress
- How to hide/remvoe unnecessary field/section in post edit section ( Dashboard )
- Shortcode content is not showing. Only the [shortcode-tag] is showing
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- Gutenberg component in a plugin admin
- Scripts/styles not loading on cloned WP Site when logged in
- Including content into an add_shortcode() function
- How to integrate plugins into block editor
- How can I measure CPU and RAM used by my theme or plugin
- Add custom html classes to gutenberg wrapper
- How to get access the ID of all posts of custom post type in Gutenberg editor
- How to create save function for custom Gutenberg style block?
- Custom Plugin activation error in Multisite
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- Pass javascript result to shortcode executer function
- set a custom post type to a taxonomy term programmatically in metabox
- Custom premium registration form and profile page for a WordPress Web Application
- redirect_to how to make it simply work with get parameter or similar?
- Some data has already been output, can’t send PDF file – fpdf issue in WordPress
- Warning: Illegal string offset – on homepage
- My enqueue admin style function doesn’t work because of ?=ver
- Determine if the current page, is being edited
- Can i prevent the effect of the_title filter on the dashboard’s posts/pages titles?
- Not able to Update database while creating a custom module
- Shortcode from a plugin not working
- Is it possible to modify an Elated plugin portfolio-list template in such a way that it will not conflict with future plugin updates?
- How to embed or integrated a custom WordPress Widget into the theme?
- Post Pagination does not working on WP-Query
- How to destroy or dispose wordpress uploder/manager?
- How to CRUD from wordpress database in wordpress theme?
- Which filter to use to pre-parse form elements, which are generated by plugin’s shortcode?
- Woocommerce Custom Checkout
- Dynamic sidebar areas not working on the Theme Customizer
- Looping single post in a theme
- Font Awesome stopped showing icons, shows &# text instead [closed]
- Merge Codes using redux framework
- To remove rendering of menus and header, plugin or theme?
- To remove rendering of menus and header, plugin or theme?
- Managing Custom Designed Content
- Is there a way to tell if a shorcode’s handler is being run before or after the content formatting filter?
- WordPress permalink setting
- Custom theme and plugin updating
- How to add conent (text) to Add New pages form of admin in WordPress
- Issue on Getting Images URL of the Post Gallery
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- How can I add recent posts to menu like mashable