What you are looking for is RawHTML to render on the front end.
To use a player shortcode in the post you can use the code below remember that the edit function needs to mirror the markup for the save function for Gutenberg to validate the block.
Include RawHTML:
const { RawHTML } = wp.element;
Save & Edit Functions:
edit: function( props ) {
return (
<div>
<RawHTML></RawHTML>
</div>
);
},
save: function( props ) {
var myShortcode="[custom-shortcode param_1="value_1" param_2="value_2" /]";
return (
<div>
<RawHTML>{ myShortcode }</RawHTML>
</div>
);
},
Related Posts:
- Shortcode to Gutenberg-block: additional text on front-end and conditional display
- gutenberg widget outputting paragraph marks
- is_admin() returns false in save_post hook with Gutenberg editor
- Wrap shortcode inside custom block
- Instagram URL is converted into oEmbed
- Gutenberg Block with Select from JSON-File
- add action only if gallery shortcode attribute is equal to?
- Gutenberg Shortcode Fail
- Gutenberg Shortcode Chooser Block
- Gutenberg Shortcode will turn html to html entity
- Gutenberg running code only available in front end within shortcode
- Shortcode, vs blocks, vs templates – what would you do for choosing or creating custom post data in editor?
- How to use code in an editor block?
- Display a block conditionally based on user input button
- how to have the gallery shortcode output one single UL list instead of several DL?
- WordPress transients for a shortcode
- Get post id shortcode
- How to handle valueless attributes in shortcodes?
- How execute shortcode with javascript
- How to render complicated shortcodes
- Getting attribute value from shortcode
- My shortcode is not working in Contact Form 7 Message Body
- How to make this shortcode work for post content
- manipulate a plugins shortcode
- What is the $atts parameter in shortcode_atts()?
- Shortcodes output in the wrong order
- How to link to a page that has a shortcode?
- Adding short codes from a page’s content on header and hiding the same from page’s content
- Should I cache default WordPress gallery shortcode output?
- Audio and video shortcodes not working properly
- How to load shortcode sooner
- Tinymce list of shortcodes button
- Add page title as a javacript variable to specific posts
- How to create a shortcode for custom page template
- How to add and submit input fields using a shortcode?
- Pass javascript array to shortcode
- Shortcode: display list of created shortcode in popup
- Shortcode return $content vs do_shortcode($content)
- Use shortcodes in custom metabox using wp_editor?
- Shortcode not working with WordPress updated
- WordPress Shortcode callback function with a plugin
- Where to filter Shortcode string prior to execution
- Media added with shortcodes not “linked” with post
- Specifying a single file from multi-file GIST (wordpress.com) [closed]
- Problem with multiple shortcode in page template
- Saving post content to database with do_shortcode?
- Is it important to sanitize inputs in a shortcode that will be used in site that only I will post to?
- Get page content and execute shortcodes on a page
- Shortcode Function not working
- Using shortcode to display array in array
- Custom recent-posts shortcode’s thumbnail image not in line with rest of code
- How can i share codes on my blog?
- How to dynamically add wordpress shortcodes
- Why does WP display the actual shortcode not the string that’s meant to replace it?
- Getting error on submitting form using Ajax with shortcode
- Using the title of the post in a shortcode
- shortcode with conditional results if logged in
- Can I pass parameters to the add_shortcode() function?
- Hijack WordPress Shortcode attribute
- How to find specific shortcodes in a post or in a widget and pass them to a variable?
- how can I change my font color for Shortcode [closed]
- Create a function to display HTML/data based on site admins role?
- AJAX and do_shortcode
- FontAwesome Shortcode isn’t working properly
- Change variable value for different shortcode attributes?
- Custom user registration shortcode – redirect header issue
- Call Shortcode on wp_footer
- How to copy [gallery] shortcode between posts using polylang [closed]
- Shortcode not displaying video as expected
- Adding shortcode of “Random Content” Plugin in the post after the title
- How to Display Shortcode’s Content after Short Product Description?
- From a shortcode I want to pass a value to display a different page
- Jetpack gallery shortcode with slideshow
- Shortcode atts for WP Query args
- return an array with a shortcode
- wp.blocks.registerBlockType not showing what I want on the frontend
- PHP not outputting the onclick in anchor tag
- Create Button for Shortcode in Text Editor
- Send Mail with link to current_user
- shortcode atts not working
- do_shortcode for is_page(slug)
- Custom Login in Shortcode got error
- Nested WordPress Shortcodes of Different Types
- Created a shortcode, using it twice (but differently) on a page but its just outputting the same one twice
- Access Shortcode in ajax code?
- WordPress Not rendering short code properly?
- Initialize add_action() for every copy of a specific shortcode
- WP_Editor Shortcode Issue
- Shortcodes that are created based on user input information
- Remove some tags from shortcodes output? Trying to fix autop
- do_shortcode & render custom field won’t work
- shortcodes inside shortcode to sum values
- is_mobile as shortcode
- How to attach sidebar to shortcode’s output?
- Is it possible to change a shortcode parameter based on a media query?
- Shortcode append to the the_content()
- Wrapping a function in html tag and return?
- Working with Shortcode, AJAX, Elementor
- How to exclude some cats from wp_list_categories using shortcut
- How can I create a shortcode that shows a list of categories on the single product page?