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
- How can I remove the wp_autop filter from a shortcode block in a block theme page template (twenty twenty-three)?
- Shortcode always displaying at the top of the page
- short code output too early
- Create custom [sourcecode] shortcode, the right way?
- TED talks shortcode not working
- What is the best way to enable nested shortcodes?
- Set wmode attribute to transparent for the embed shortcode to make drop-down menu hover over YouTube embed in Internet Explorer
- how do you get the author’s username?
- do_shortcode inside AJAX callback
- shortcode_unautop shortcode not functioning
- How can I run shortcode after click with ajax
- Execute shortcode within shortcode
- How to create a shortcode to display a category description?
- shortcode not working and the relation to the_content()
- Extending Shortcode attributes
- If numberposts = -1 offset won’t work
- shortcodes between square and curly brackets
- Shortcode are not working in Option tree textarea
- Font Awesome Icons Won’t Work
- How to Get a part of URL and put in shortcode?
- How can a shortcode can take the place of the featured image in a post?
- Shortcode for Twitter Bootstrap Collapse
- Is there any inherent difference between add_filter() and add_shortcode() for modifying [caption]?
- get_shortcode_regex() only matches first shortcode
- How do I debug a short code?
- How to type shortcode-like text in WordPress TinyMCE visual editor?
- Does registering multiple shortcodes impact performance?
- Gallery shortcode – change link file image size? (not using default fullsize image)
- How can I hide the Permalink/Shortlink for certain user logged in Users of a certain level?
- How to force that styles are enqueued in the header?
- How To Conditionally Include A Short Code Depending On The HTTP_REFERER [closed]
- Shortcode for order number [closed]
- Create shortcode in WordPress, using one variable in 3 functions?
- Adding javascript actions to words in post content
- Placing tags on wordpress visual editor using shortcodes
- Using Variables in Shortcodes
- Default Attributes in Shortcode Not Working
- Replacement for gallery_shortcode function not taking all attributes
- Shortcode syntax errors
- how can i pass this attribute in this shortcode?
- Display a form partially with a shortcode
- Modifying the wordpress login page and then referencing it with a shortcode problem
- How to make shortcode which returns HTML?
- Render shortcodes with get_post_custom
- How to create a custom shortcode for custom login form?
- Enclosing Shortcode not working in a Template
- Set redirect for need login
- make user_id in a shortcode dynamic based on who’s logged in
- pass complex json as shortcode parameter
- Image Caption Shortcode Broken upon update
- Customizing the wp_video_shortcode output with add_filter
- Shortcode not working in CPT taxonomy
- wp_enqueue_scripts does not work on admin page
- How to embeded shortcode for another website
- To know whether insert shortcode in custom meta box
- Shortcodes not working in custom page
- Get label in user meta query
- Shortcode not being executed
- Using within a shortcode
- Shortcode not working when I output data from wpdb html table row
- How do I point bloginfo(‘stylesheet_directory’) to my parent theme?
- Add audio file to post using custom term meta field as link [closed]
- How to list child pages with excerpts, e.g. [child-pages depth=”1″ excerpt=”1″]
- Add a shortcode in woo-function.php
- Woocommerce products shortcode specific order
- Modify Blog Module layout in Child theme
- Video shortcode outside WordPress not working with IE and mediaelement’s Flash fallback
- Display title of child pages in shortcode
- Output html source tags inside shortcode
- How can I define the output of shortcode attribute value?
- What is the best way to include a template file within a shortcode?
- Shortcode templates
- Create plugin/function to catch XML-data via Shortcode
- Why My slider shortcode display above header
- Does anyone recognize shortcode ig_special_heading?
- How to scroll to a shortcode-generated anchor
- add post type pram to wp shortcode
- Shortcode conversion to hrml when post is published
- Shotcode error on functions
- Shortcode for displaying the user’s first name?
- Can I prevent wordpress adding and tags to autoembeds
- Shortcode – Display inline icon before text [closed]
- How to pass text input data to shortcode
- How to handle Ajax Calls, when using same shortcodes (with different parameters, e.g. ‘post-type’)?
- conditional shortcodes
- shortcode appears as text in the search result