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
- Validation error: Extending Gutenberg gallery block
- A better way to override plugin’s JS files?
- How can I reduce the amount of files loaded/included per plugin?
- How to create gutenberg block using REST API independently or as headless way?
- Why my browser keeps loading old version of custom JavaScript files in \divi\js? [closed]
- How to use wp-ajax in wp-cron
- Dequeue / Deregister script and replace it with a new plugin
- Add extra parameter in tag using script_loader_tag
- Insert code after tag without using functions.php?
- Adding with javascript to admin bar. Works in Chrome/Safari, not Firefox
- How to find out what blocks are added by a plugin
- Reuse javascripts from plugins within the theme
- Localiztion in javascript
- WP-Cufon adding extra space in my paragraphs in Firefox and Chrome
- Best approach to fetch data from wp options to js file or php file
- wordpress site | All-in-one-cufon IE Issue
- How to get the element ID from new menu list that added with add_filter()?
- Override Plugin Script Fucnction in WordPress
- Gutenberg block can’t save richtext
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- Is there a standard way to listen for an on change event of a posts featured image
- How to insert HTML/JavaScript form into WordPress page? [closed]
- How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]
- 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
- Would Gutenberg be considered a PlugIn?
- Can’t get Gutenberg InspectorControls to work
- How to add custom table style for table block in gutenberg editor
- how to prevent all css and javascripts files from loading
- wordpress add_action() issue in ajax call
- Localizing methods for jQuery append prepend wrap parent
- Which plugin can do horizontal scrolling of RSS feeds in WordPress [closed]
- “uagb/section and uagb/columns block”
- WordPress Editor completely blank [closed]
- Why does my jQuery plugin show up as text in WordPress?
- Disable submit button order
- how to request a script more than once in wordpress
- How to turn off automatic operation for Nivo Slider?
- CSS/JS files in WordPress
- Wp-minify doesn’t seem to minify my JS code
- Custom Plugin scripts from admin working in frontend
- Ajax call not working in wordpress through a plugin
- Gutenberg default attributes are empty when accessing in edit
- WP REST API GET Method Works But Not The POST Method
- WordPress Gutenberg custom block
- Cannot run script properly with my custom plugin
- Overriding inline !important CSS with Javscript code snippet with media query
- How to dynamically add template in Innerblock?
- Add style to body based on url
- Performing CRUD operations on front end in wordpress
- How to add specific script to WordPress webpage that will working with user input and databases
- Ajax Call not Working in Plugin
- WordPress Gutenberg How to make TextControl Required?
- Better search on WordPress.org Plugins?
- Add external javascript to post template
- Why can I not deregister my style and script on custom post type?
- AJAX update fails for public/non-admin users
- Implementing Scrollable Images
- Javascript inserted from Plugin pointing to wrong location
- Conditional Fields depending on checkboxes
- How to pass value from WordPress to Javascript
- Facebook Quote Plugin for Blockquote?
- Adding javascript to header of MetroMagazine theme
- Javascript in plugin not working
- Jetpack Comments Change Placeholder Text
- Media Playlist Plugin
- Adding an onchange event to a custom dropdown menu in WordPress
- Possible jquery / library conflict in plugin usage
- Plugin and javascript placement
- Why won’t the Comprehensive Google Map Plugin load?
- get_option include in my adsense
- Expanding / Collapsing Modules in WordPress Panel
- making a simple plugin
- Javascript as Jquery Function Call?
- Block registration with viewScript
- Custom gutenberg block image preview not working
- How can I utilize the same “show more” functionality that I see in superuser on my own WordPress site?
- Gutenberg Block to Select Category Term
- Beginner question: Accessing js script in plugin
- How do I set register_meta for a specific CPT?
- Update Content for a Custom Block Toolbar Button
- How can I display an attribute from each post inside foreach($latest_posts1 as $post )
- Wrong block appender button showing
- Select posts from list and add them in a new list
- How to get custom setting from get_option and pass it in getEntityRecords in gutenberg block?