Skip to content

Instantly share code, notes, and snippets.

@clarklab
Created October 22, 2012 16:49
Show Gist options
  • Select an option

  • Save clarklab/3932502 to your computer and use it in GitHub Desktop.

Select an option

Save clarklab/3932502 to your computer and use it in GitHub Desktop.
Post format picker
function post_format_picker () {
$screen = get_current_screen();
if ( $screen->id == 'post' ) {
echo '<script>jQuery(document).ready(function(){
var hash = window.location.hash;
if (hash){
jQuery("a[href$="+hash+"]").click();
}});
</script>';
}
}
add_action('admin_head', 'post_format_picker');
@clarklab
Copy link
Author

For use with Alex King's post format UI plugin: this is a quick and dirty way to select a format tab on pageload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment