Skip to content

Instantly share code, notes, and snippets.

@kraftbj
Last active November 20, 2015 22:22
Show Gist options
  • Save kraftbj/cec8399dd893cf9b8b4d to your computer and use it in GitHub Desktop.
Save kraftbj/cec8399dd893cf9b8b4d to your computer and use it in GitHub Desktop.
Force Publicize's post editor settings to expand.
<?php // do not include in an existing PHP file or you can upload this entire file as a plugin.
/*
* Plugin Name: Jetpack: Auto-Expand Publicize Settings
* Plugin URI: http://jetpack.me
* Description: Custom plugin to auto-expand the Publicize settings when writing a post.
* Author: Brandon Kraft
* Version: 1.0.0
* Author URI: https://kraft.im/
* License: GPL2+
*/
add_action( 'admin_head-post.php', 'kraft_auto_open_pub_meta' );
add_action( 'admin_head-post-new.php', 'kraft_auto_open_pub_meta' );
function kraft_auto_open_pub_meta() { ?>
<script type="text/javascript">
jQuery(window).load(function(){
jQuery('#publicize-form-edit').trigger('click');
});
</script>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment