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 can I remove the wp_autop filter from a shortcode block in a block theme page template (twenty twenty-three)?
- What does extract( shortcode_atts( array( do?
- How do I escape a ‘]’ in a short code?
- Redirect function inside a Shortcode
- Remove wpautop from shortcode content / remove whitespace in buffering
- Shortcode in shortcode: How to append variable?
- How can i put an array as variable in shortcode_atts?
- Table of Contents with a shortcode
- Using action hooks inside of a shortcode
- Using shortcodes in PHP
- Remove width and height attributes from [gallery] output
- Is it possible not to define category on function.php and add the shortcode [shortcode cat=1] to display the products?
- Get Shortcode Attributes
- How I make a shortcode for this code?
- Problem with email_exists in shortcode
- Shortcode doesn’t work with classes
- Get shortcode from the content and display it in other place (in sidebar, for example)
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- Alternate text if shortcode returns no data
- Global, network-wide shortcodes or text replace functions
- Adding shortcode to the main menu
- How to use div class between the shortcode variable?
- Error do_shortcode In WooCommerce Template
- Executing a shortcode from a “normal” text/hyperlink
- Execute shortcode only once in the page
- Two different inner shortcode under shortcodes or multiple nesting of inner shortcodes
- Extra paragraph tags in an enclosing shortcode
- Order Woocommerce Products by Latest Reviewed
- $content not null in shortcode, even though it is self closing
- Nesting shortcodes results in the inner shortcode being placed AFTER outer shortcode
- Create a shortcode that creates a form for users to edit their information
- How to split text text text into array
- Shortcode multiple values
- How do you stop a shortcode from firing in the editor?
- menu item to display the most recent post
- how to format / execute post content and shortcode?
- Documentation for adding a tinyMCE view for visual live preview of custom shortcode?
- How can I implement shortcode on click event
- Login form from shortcode doesn’t redirect after successful login
- How to list users by custom field?
- Form Shortcode not saving data to WP database
- Responsive Embeds using default embed shortcode
- problem with shortcodes nesting
- OOP and WordPress shortcode
- Convert my php code into shortcode
- Custom shortcode breaks my page
- Shortcode is not working
- Custom shortcode is causing a WSOD
- Why can’t I display attachment_image_src with Custom Size?
- Get attributes of nested shortcodes
- Shortcode into the same shortcode
- How to create a shortcode to let the user add the ID of a YouTube video?
- Execute shortcodes in PHP
- A shortcode nested inside a shortcode
- How to add shortcode to html widget
- Custom Shortcode + Querying and Ordering Posts using multiple Advanced Custom checkboxes
- Add div on EMED Tag
- call other shortcode in the email contactform7 send [closed]
- Putting a space between the buttons [closed]
- Processing a login/register form before shortcodes are rendered?
- Adding a cover image to video shortcode
- Insert First Image into post (full-width)
- Dynamic number within shortcode
- Returning HTML to Shortcode Block
- WP REST API remove the WordPress shortcodes from the JSON wp/v2/posts content->rendered
- How to display html element and php string in the same line?
- Hide download option video shortcode
- WordPress Shorcode Display hierarchical taxonomy [child, parent]
- Shortcode not working in Jetpack Top Posts & Pages widget
- Restricting shortcode for users
- create shortcode that changes url endpoint
- Convert WordPress shortcodes into plain html
- Attributes are not passed on nested shortcode
- How to make a shortcode with a line break in it parse correctly?
- Removing text + shortcode from all posts
- Shortcodes: override a shortcode / change shortcode on the fly
- Access the resized images generated by `add_image_size()`
- Defining the output of a WordPress Att
- Custom WP theme not showing shortcodes
- Shortcode for sectors
- A number appears inside a div called wpb_wrapper, when I use a custom shortcode
- Enclose article’s body with default shortcode
- Why is my ajax live search not working when i use a shortcode to call it?
- Shortcode with foreach
- WordPress shortcode select option not working [closed]
- Trying to create a shortcode that displays taxonomy terms in a dropdown