Customize Default Gallery

Purpose:

Default gallery thumbs show only description, not caption. This revise is to hide description and show caption.

Source:

  1. /wp-includes/media.php
  2. /wp-includes/post-template.php

function gallery_shortcode( $attr ){} in media.php:

		if ( $captiontag && trim($attachment->post_excerpt) ) {
			$output .= "
				<{$captiontag} class='wp-caption-text gallery-caption'>" . 
				//wptexturize($attachment->post_excerpt) . //Show description
				wptexturize($attachment->post_title) . //Show caption
				"</{$captiontag}>";
				//echo var_dump($output);
				//exit();
		}