It seems that this helped:
$is_backend = defined('REST_REQUEST') && true === REST_REQUEST && 'edit' === filter_input(INPUT_GET, 'context', FILTER_SANITIZE_STRING);
if ( $is_backend == true) {
$url = "#void";
} else {
$url = get_permalink( $post_id );
};
$link = '<a ' . $fontsizeattr . ' href="' . $url . '" target="_self">' . $game_title . '</a>';
return "<p>" . $link . "</p>";
#void worked for me.
Related Posts:
- Getting a custom Gutenberg component’s state from outside that component
- Difference between register_block_type & wp.blocks.registerBlockType
- Passing select control value to block
- Passing RichText attributes to function onChange
- Can I share predefined fonts from theme_support with a gutenberg component?
- How do I store information in a dynamic block in WordPress?
- Gutenberg List Extension Block
- How to add Internationalization in WordPress using Javascript/React?
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- Fixed: Console.log twice in the edit function
- Possible way of having multiple Gutenberg instances for a page?
- How to create a custom block in Gutenberg with multiple checkboxes?
- Refresh server side rendered block in Gutenberg without changing attributes or its content
- Vanilla javascript in custom gutenberg block not working
- Implementing onSplit/onMerge in dynamic Gutenberg Custom Blocks
- WordPress Gutenberg Custom Block the viewScript does not get loaded on the frontend when my block is inserted
- How to load plugin after page is loaded – pagespeed issues
- How to use get_theme_mod in gutenberg editor wordpress?
- add mediaelement.js plugins into WordPress video player control bar
- Shortcode button dosent work for all posts. Work for first post only
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- React JSX in WordPress Plugin Development
- Internationalization autocomplete JS variable
- Plugin echos text from shortcode function in gutenberg page editor
- How do I prevent the link from using url of the image in Block Editor?
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- Using custom JS plugins with WordPress?
- Override Javascript in a Plugin?
- How to disable specific plugin in mobile version?
- Is there an earlier hook than login_head or login_enqueue_scripts?
- Best approach to fetch data from wp options to js file or php file
- Can someone please tell me what is wrong with my plugin?
- Updating the Drag-To-Share eXtended share URLs?
- Scripts at the end of the page
- wordpress site | All-in-one-cufon IE Issue
- Enqueue WordPress plugin scripts below all other JS
- how to disable blockrenderAppender inside all Innerblocks?
- Can I use custom CSS and js plugin to put JavaScript in to validate my forms
- Cannot find a list of data selectors for Gutenberg editor
- WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal
- Change upload folder for a CPT
- How to get the element ID from new menu list that added with add_filter()?
- Override Plugin Script Fucnction in WordPress
- Time consuming callbacks in customizer
- Add button gutenberg help
- className not populating in custom block
- Gutenberg block can’t save richtext
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- add image crop function like in wp customizer
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- Executing Javascript when a New Post is Published
- Use gutenberg block editor on plugin page (outside of a post)
- Using SVN to upload plugin created with gutenberg blocks
- Set featured image using javascript in post editor
- Display encrypted content on my website
- I am not receiving className in a ServerSideRender component
- Is there a standard way to listen for an on change event of a posts featured image
- How to edit content before post update
- Will Gutenberg Have a Negative Impact on Page Speed?
- Trying to create a private area custom for each user where they upload images to a server [closed]
- wp.media javascript issue with on select
- WordPress + JavaScipt + AJAX + MySQL: insert query for form
- add input in custom javascript from WordPress pages/posts
- Advanced AJAX Page Loader ignores other JS code
- How to insert HTML/JavaScript form into WordPress page? [closed]
- accessing wp.media api from a tinymce plugin
- Add custom JavaScript that is a combination of CDN/uploaded files and easily-edited code?
- How to load wp_editor via AJAX
- Redux Framework: Page freezes on typing in Editor
- How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]
- How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?
- WordPress 3.8.3. custom theme – sliders won’t load js/css files
- Using TinyMCE in plugin?
- Using window.onload with Ubermenu
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Gutenberg: Block SelectControl saves attributes but after a reload of Gutenberg it loads its defaults. Why?
- Redirect to another page using contact form 7? [closed]
- Would Gutenberg be considered a PlugIn?
- Is there a loading priority for login_enqueue_scripts?
- Can’t get Gutenberg InspectorControls to work
- Delay JavaScript files from loading
- “Conflict” with jQuery (or its plugins)?
- How to add custom table style for table block in gutenberg editor
- Gutenberg Block Style CSS Class Is Not Applying on Backend
- JavaScript in a PHP plugin
- Why is the ‘Gutenberg’ Plugin generating an ‘Inconsistent File Permissions’ error when other Plugins, with the same permissions, do not?
- Deactivate JS Script in Plugin Shortcode
- how to prevent all css and javascripts files from loading
- Remove / overwrite some functions in buddypress.js
- wordpress add_action() issue in ajax call
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Localizing methods for jQuery append prepend wrap parent
- How to execute a plugin on a single page only?
- how to insert a HTML form into a javascript popup?
- Display a consistent Google Plus icon on ALL pages of my site
- MediaElement.js works on one site but not the other?
- Which plugin can do horizontal scrolling of RSS feeds in WordPress [closed]
- Pass user role to javascript code inside body
- Gutenberg Blocks – Cannot retrieve block saved attributes in edit post