-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set default link for images using image_default_link_type option #25578
Conversation
Size Change: +121 B (0%) Total Size: 1.17 MB
ℹ️ View Unchanged
|
e711561
to
d56b084
Compare
Tested using "file" & "post" and this is working as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thanks |
can i disable images inserting from url? |
Description
Use the option for image_default_link_type to set default link for images.
The related PR for galleries is #25582
Fixes #10173
How has this been tested?
image_default_link_type
to "file" or "post"You can set by going to your site's
wp-admin/options.php
page or via a plugin using a function like:Types of changes
This unsets the default link type in Gutenberg none in favor of the WordPress option default. It checks to see if the option is set and sets the linkDestination based on the option.
There is an unfortunate mismtach between what Gutenberg thinks the option should be and what the historic option values are. The classic editor and previous use
file
to represent Media File, andpost
to represent "Attachment Page". The Gutenberg constants used aremedia
andattachment
.