Created
August 14, 2019 13:49
-
-
Save versluis/baf0c710c56dea6e0a42ea892fee1338 to your computer and use it in GitHub Desktop.
make Gutenberg Galleries link to Media File by default
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make galleries link to Media File | |
// https://wordpress.stackexchange.com/questions/115368/overide-gallery-default-link-to-settings | |
function make_galleries_link_to_file() { | |
$post_type_object = get_post_type_object( 'post' ); | |
$post_type_object->template = array( | |
array( 'core/gallery', array( | |
'linkTo' => 'media', | |
) ), | |
); | |
} | |
add_action( 'init', 'make_galleries_link_to_file' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment