Skip to content

Instantly share code, notes, and snippets.

@jordanmaslyn
Created February 5, 2016 22:14
Show Gist options
  • Save jordanmaslyn/b1cd3bb713e4af53244a to your computer and use it in GitHub Desktop.
Save jordanmaslyn/b1cd3bb713e4af53244a to your computer and use it in GitHub Desktop.
Set Wordpress default media options that WON'T get overridden by user cookies
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', 'medium' ); // thumbnail || medium || large || full
setUserSetting( 'urlbutton', 'none' ); // none || file || post
}
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment