Skip to content

Instantly share code, notes, and snippets.

Created August 14, 2019 13:49
What would you like to do?
make Gutenberg Galleries link to Media File by default
// make galleries link to Media File
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