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
- How to include jQuery and JavaScript files correctly?
- How can I configure Docker for developing and deploying a custom theme?
- Add self-closing shortcode button to TinyMCE in WP 4.6
- jQuery in header or footer
- Adding pre-publish checks with Gutenberg
- How to make repeated component/block in Gutenberg
- How to make WordPress use non-greedy shortcode parsing?
- Multiple Parameters for a Shortcode
- Catch own Exceptions
- How can I fix those issues generated by the Themecheck plugin
- How to get data from WordPress $wpdb into React Gutenberg Blocks Frontend?
- Escaping built-in WP function return strings
- Front-End Form Submission in Shortcode
- Customizer Not Saving Options
- What’s the Right Way to get and save remote data for a Gutenberg block?
- What function to hook for changes made in status and visibility of a post
- Example of uninstaller routine to remove all custom theme options from wp_options
- How to disable “Transform to” option in Gutenberg custom blocks
- Modify a Free Plugin available on wordpress.org & include with my Premium Theme? [closed]
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- How do I write a shortcode that opens and closes?
- Using a Shortcode to Replace Themes Stylesheet?
- Initial help with official “create a block” tutorial
- WordPress not working on localhost
- Creating a Link Text like Submit Button in Admin Page
- How do I dynamically render an InnerBlock inside a dynamic block?
- SQL query for custom taxonomy slugs
- Run code once when block is created
- Best way to save custom css for an block
- How to hook a custom user function to a wordpress core ajax action?
- How can I listen to events in Gutenberg block?
- ResizableBox with RangeControl not working
- Asynchronously render shortcodes in TinyMCE visual editor
- Shortcode returning localized HTML part
- Hide shortcodes “code” when using the “editor” the same as wordpress do with “gallery”
- Enumerating shortcode attributes in JavaScript
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Template directory in plugin
- unable to wp_enqueue_script(‘suggest’);
- Drawing the line between theme & plugin on large scale bespoke projects
- Apply styles to blockquote element with the WYSIWYG editor
- How to add plugin options in wp editor page
- How to display the categories on page using shortcode?
- Shortcode Attributes to Return different $_POST
- How to use apiFetch to get author information in Gutenberg properly?
- Shortcode conflicts
- Setting global block attribute value
- How to display the specific post content by using POST ID
- How to output functions from plugin inside theme
- Create fixed static pages
- Including template in shortcodes
- “Rendering of admin template [path to template] failed”
- Custom Block Not Shown in Block Inserter
- Why my theme’s css not working on another site
- 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?
- Override category archive page title (not the head title)
- By adding “?login – failed” code unable to access my dashboard
- How can I pass WP_Query results to a plugin?
- Get value of custom checkbox from Gutenberg sidebar in plugin
- Metabox types list
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Rate limiting ajax requests in WordPress
- Some data has already been output, can’t send PDF file – fpdf issue in WordPress
- Dynamic sidebar areas not working on the Theme Customizer
- Merge Codes using redux framework
- Issue on Getting Images URL of the Post Gallery
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- variable created in page.php is null inside of header.php
- Identifying a Page Containing Shortcode at `init`
- Updating Style From WP Options Setting Page
- add short code not working
- append code after the_content not working
- Problem with Poedit [closed]
- Shortcode attribute “title” doesn’t appear in $atts array
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Build a dynamic block using the default attributes
- How to display .ptm file in my WP site without JAVA
- How to replace content of a block in and re-render on change?
- extending a core block doesn’t work inside the editor