What’s up with attachments linking to other attachments?

What’s up with attachments linking to other attachments?

Something I’ve recently noticed in all of the Twenty * bundled themes is that media on the attachment pages are auto-linked to the next media in the gallery. What’s the point of having Next/Previous pagination links if you’re going to link the media anyway? I’d venture to say that if the media links to anything, it should be to its source.

Add ‘Edit User’ Toolbar link on author archives

Currently it takes 3-4 steps to get to a user’s edit screen from the front-end, which really comes down to a lot of wasted time when you’re working on a user-heavy site. One of my biggest usability pet peeves is unnecessary extra steps. On the WordPress front-end, we have ‘Edit *’ Toolbar links for objects like taxonomy terms and post types, so why not users?

The question was raised recently by John Blackbourn on Trac and I think it has a lot of merit. I’ll concede that the inherent behavior of an edit link on an archive shouldn’t be to edit an object but an author archive (usually) serves dual purposes: Author info and author archive.

Here’s the snippet I worked up from @lessbloat’s revised patch:

function ww_toolbar_edit_user_link( $wp_admin_bar ) {
	$current = get_queried_object();
	
	// Check that it's a WP_User object and user is editable
	if ( is_a( $current, 'WP_User' ) 
		&& current_user_can( 'edit_user', $current->ID ) ) {
	
		// Add the menu
		$wp_admin_bar->add_menu( array(
			'id' => 'edit',
			'title' => __( 'Edit User' ),
			'href' => get_edit_user_link( $current->ID ),
			'meta' => array(
				'title' => __( 'Edit User' )
			)
		) );
	}
}
add_action( 'admin_bar_menu', 'ww_toolbar_edit_user_link', 81 );