Use it like this, this defined(‘REST_REQUEST’) will help you to disable running on the backend gutenberg block editor
function generate_new_member_form() {
if(defined('REST_REQUEST')) return;
ob_start(); ?>
// a form
// to generate this form there is some code that uses objects or functions
// only available in the front end
<?php return ob_get_clean();
}
add_shortcode('new-member-form', 'generate_new_member_form');
Related Posts:
- Shortcode to Gutenberg-block: additional text on front-end and conditional display
- How to save a shortcode in a Gutenberg custom block?
- 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
- 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
- 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?
- 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?
- Prevent add_shortcode from escaping a tag
- Shortcodes not working in an AJAX call
- Remove HTML content if attribute is not set / variable attributes
- Legacy Audio Shortcode
- Extending the Audio Shortcode
- How resource intensive is wp_register_script()?
- Convert shortcode into html form [closed]
- Numbering Image List in Gallery
- Register visits of my pages in wordpresss
- List monthy archives for specific year with wp_get_archives
- How can I included CSS to a page or a shortcode? [closed]
- Two Shortcodes in one page not working
- Call Shortcode inside another Shortcodes callback
- Creating a shortcode in a plugin that includes JS
- Shortcode to delete post from front end
- Plugin echos text from shortcode function in gutenberg page editor
- How to parse shortcodes within returned content
- Hook WP_Embed run_shortcode
- Get Required Assets (JS, CSS etc) for post using REST API
- shortcode in snippet plugin not work
- AJAX and Shortcode with Parameters
- Detecting embeded video format
- How to prevent shortcode preview from breaking in tinymce editor?
- How to protect parts of my code from TinyMCE modification when switching from text to visual mode?
- 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?
- 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
- Help with a function to create a shortcode
- How to use strip_shortcodes() from a spawned process?
- How to completely prevent WordPress from destroying/modifying my shortcode outputs?
- Term Description Echo or Return – display problems
- Same Shortcode not executing second time
- Check if Page=current user page via shortcode
- Is it inefficient to repeat a Shortcode 100 times on a page?
- tinymce custom button
- WordPress Payment link will not transform PHP vars into values
- Referring to site URL in shortcode argument
- Does a String Replacing script affect shortcode output?
- Shortcode for showing childpages
- How to create shortcode for auto login after registration
- How WordPress Displaying Shortcode In Post Content?
- Shortcode not accepting atts
- the_time function inside HTML dom parser
- Code auto escaping is not working when using short codes
- How to Convert Shortcode into a link?
- wp_register_script and wp_register_style when shortcode is used
- Wpautop stops working after get_the_excerpt
- Show realtime Amazon price without API using shortcode
- Identifying first and last instance of shortcode in post
- Executing a shortcode at the top of PAGE template?
- Custom shortcode with < in content