Created
September 4, 2011 22:13
-
-
Save chrisguitarguy/1193612 to your computer and use it in GitHub Desktop.
Adds an image above the title on the WordPress post editing screen.
This file contains 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
<?php | |
/* | |
Plugin Name: Image Above Title | |
Plugin URI: http://pmg.co | |
Description: Adds an image above the title on the WordPress post editing screen. | |
Version: n/a | |
Author: Christopher Davis | |
Author URI: http://pmg.co/people/chris | |
License: creative commons/GPL2 | |
*/ | |
add_action( 'dbx_post_sidebar', 'wpse27700_add_image' ); | |
function wpse27700_add_image() | |
{ | |
echo '<img id="wpse27700-image" src="http://placebear.com/500/100" alt="wpse27700 bear" style="display:none;" />'; | |
} | |
add_action( 'admin_head', 'wpse27700_admin_head' ); | |
function wpse27700_admin_head() | |
{ | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function(){ | |
var wpse27700 = jQuery('#wpse27700-image'); | |
wpse27700.remove(); | |
jQuery('#titlediv #titlewrap').before(wpse27700.show()); | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+1 for placebear