Created
October 22, 2012 16:49
-
-
Save clarklab/3932502 to your computer and use it in GitHub Desktop.
Post format picker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For use with Alex King's post format UI plugin: this is a quick and dirty way to select a format tab on pageload.