I'd like to change the default size for images within posts. I've tried to edit both the /wp-admin/options.php page and the functions.php file, but none affect the size. They do work for the default alignment and the default link, but not for the size.
Here's the snippet from my functions.php file
add_action( 'after_setup_theme', 'default_attachment_display_settings' );
function default_attachment_display_settings() {
update_option( 'image_default_align', 'right' );
update_option( 'image_default_size', 'large' );
}
The images keep showing up as "full size".
That option seems to be ignored by the editor, but this works:
add_action( 'admin_head-post.php', '_my_reset_image_insert_settings' );
add_action( 'admin_head-post-new.php', '_my_reset_image_insert_settings' );
function _my_reset_image_insert_settings() {
?>
<script>
if ( typeof setUserSetting !== 'undefined' ) {
//setUserSetting( 'align', 'none' ); // none || left || center || right
setUserSetting( 'imgsize', 'large' ); // thumbnail || medium || large || full
//setUserSetting( 'urlbutton', 'none' ); // none || file || post
}
</script>
<?php
}
Snippet made by @azaozz Source: https://core.trac.wordpress.org/ticket/35101#comment:15
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With