This is covered in the documentation section directly above the one you linked, for value
:
A link
value
is composed of a union between the values of default
link properties and any custom linksettings
.The resulting default properties of
value
include:
url
(string
): Link URL.title
(string
, optional): Link title.opensInNewTab
(boolean
, optional): Whether link should open in a new browser tab. This value is only assigned when not providing a
customsettings
prop.
So you’d need to include it in the value:
<LinkControl
searchInputPlaceholder="Add Link"
value={{
url: attributes.link,
opensInNewTab: attributes.opensInNewTab,
}}
onChange={(value) => {
setAttributes({ link: value.url, opensInNewTab: value.opensInNewTab })
}}
settings={[
{
id: 'opensInNewTab',
title: 'Opens in new tab',
},
]}
suggestionsQuery={{ type: "post", subtype: 'page' }}
/>
Related Posts:
- Help Unregistering a Core Block Type in Gutenberg
- How do I get the current post ID within a Gutenberg/Block Editor block?
- Disable device preview options in the block editor
- Get the current block ID
- How do you use __experimentalLayout to give innerblocks alignment control and default layout?
- WordPress Value of Undefined in Admin
- Modify the core/paragraph block
- WordPress Gutenberg blocks: Input fields are not editable
- What’s the recommended Gutenberg component for adding a URL, in the toolbar/sidebar?
- Once Again: How to Remove Option from Gutenberg Editor for Specific Block in theme.json
- Uncaught TypeError: wp.apiFetch is not a function
- how to get a more significant error response from ServerSideRender
- Align a custom block button by wrapping it in div
- Using applyFormat (from @wordpress/rich-text) to make persistent changes to Gutenberg’s rich text value
- Block validation: Block validation failed for `my-block`
- How to set the localization for a Gutenberg block?
- How does the Gutenberg mobile/tablet/desktop preview work with media queries?
- How to render core component inside edit() within custom registered block in Gutenberg?
- Modify Core Block Default Attributes
- How to set defaults for Border controls in custom block
- Compatability of gutenberg block in older WordPress version
- Find all the places where a block type is used
- WordPress PluginSidebar, TextControl setting and saving the default value
- How can I dynamically wrap in a Gutenberg block?
- Modifying the Gutenberg Button Block
- Style Gutenberg metaboxes like they belong on the site
- How to get featured_media of a post with getEntityRecords?
- How to grab posts in Gutenberg Block?
- How can I access the attributes of a block within InnerBlocks?
- How to avoid duplicate dependencies in Gutenberg blocks
- How to update a Gutenberg block without manually recovering it?
- How to learn Gutenberg block development [closed]
- Gutenberg Dynamic Block not Storing Attributes
- Is it possible to access the wp-admin from one instance while keeping WP_HOME pointing to the balancing url?
- Show pasted link text with diacritics not encoded
- How to Add predefined CSS Classes to a Block using Gutenberg
- Updating a block’s edit / save without reinventing the wheel
- Gutenberg block missing classes inside editor
- Custom dynamic Gutenberg block not rendering
- How to get an array of custom blocks by block name
- How do I addFilter to core/paragraph to add an attribute and see the change in the editor?
- How to register a embed handler as a fallback to a oEmbed handler?
- Performance of Gutenberg block attributes with source selectors vs without
- What version of React does Gutenberg use?
- Block background color not appearing on site
- For developers, what impact can we expect Gutenberg to have on the loop?
- Why is an argument of onChange nested in … in Gutenberg custom block RichText?
- Gutenberg: Heading with subheading/paragraph
- BlockControls not showing floating (show up in the top toolbar)
- Change label text in Gutenberg’s built in excerpt panel
- Style Gutenberg Editor based on Post Type or Page Template
- Gutenberg: How filter blocks of a certain type with parse_blocks recursively?
- Gutenberg add checkbox using PluginPostStatusInfo
- How to view all currently registered block patterns?
- How do I activate a certain block template only when editing the front page?
- wp_get_global_settings is not updated on save_post hook
- How can I make Gutenberg block layout switchable without lost of current content?
- code block does not show in excerpt
- Modify src attribute on image block
- Is it possibe to prepend “ with icons or text?
- If you have multiple dynamic blocks with a post loop on a page, how do you avoid duplicates from inside the render_callback function?
- How to create Gutenberg’s pattern category automatically with custom post taxonomy terms?
- How to Change the Gutenberg editor’s colors?
- Debugging Gutenberg block with the React Profiler (React Developer Tools)
- Modify core/image block by adding inner span to figcaption in save
- How to override a function in the wp_includes folder(block supports/colors.php)
- If is block name
- Table block – Wrap table
- Is there a way to grab the current value of the editor in Gutenburg/Classic WordPress editor? (Not the saved value of the post!)
- Can I add custom code to gutenberg auto save?
- Changing block quote size in gutenberg
- How to get the revisions feature back on the classic editor?
- how to use a Text component in javascript?
- How to nest a list inside a blockquote using the Gutenberg block-editor?
- Is there an obvious error in this React code for customizing a Gutenberg Block?
- Two content editors (gutenberg blocks) on the same page
- Images are not shown in the post editor
- Gutenberg custom block: RichText underline button
- Expose Gutenberg blocks in Post Revisions API endpoint
- How to wrap Gutenberg blocks into a custom container (without using HTML blocks)?
- DateTimePicker script and style missing?
- Gutenberg pass properties to filter
- How to remove multiple blocks of Gutenberg at the same time?
- How to set the background color of a template part (Header/Footer) in Twenty Twentythree?
- Run callback on removeBlock action
- Gutenberg blocks – only allow as innerblock
- Pullquote Block Styles disappeared?
- Using useSelect creates “minified React error”
- How do I reinstate the “Add Block” feature that changes with the update?
- Change Featured image location from side to normal using react (gutenberg)
- Get postId in a wordpress pattern file?
- Remove placeholder from core/image in InnerBlocks template
- Gutenberg block not displaying prop values
- ACF InnerBlocks breaks css grid, How can we add classes to allowedblocks (WordPress Gutenberg)
- How to disable block directory?
- Adding custom link text to a URLInputButton
- Rearrange order of block into a block category gutenberg
- Gutenberg Block Deprecation – Handling old viewScript and styles
- Resaving posts to update static blocks
- How to dynamically add style tags to Gutenberg editor in react