WordPress plugin

Here's a simple WordPress plugin. Save the following as universal-edit-button.php and place it in the /plugins/ folder, then activate it in admin.

Universal Edit Button if the user has it installed. The button is an icon in the URL bar that indicates a web page is editable, and takes the user directly to the edit view. Version: 1.0.1 Author: UniversalEditButton.org Author URI: http://universaleditbutton.org/

function ueb_add_head_link { if( is_single || is_page ) { global $post; switch ($post->post_type) { case 'attachment': return; case 'page': if( !current_user_can( 'edit_page', $post->ID ) ) return; break; case 'post': default: if ( !current_user_can( 'edit_post', $post->ID ) ) return; break; }

echo 'ID) . "\" />\n"; } }

add_action( 'wp_head', 'ueb_add_head_link' ); ?>

Version History:

1.0: Initial release by Alan J Castonguay

1.0.1: Main function wrapped in conditional clause so that edit link only appears on single posts or pages. Improved plugin Description, including link to UEB site. By Stephen Rider

Thread reference on wp-hackers: wp-hackers: Universal Edit Button