我不认为您可以做到这一点,但是您可以在函数文件中实现这段代码,至少允许在单个图像标题中使用换行符
注意:不适用于画廊图像(我正在试图找到一种方法使其在画廊中工作)
/*
*********************************************
Function to allow multi-line photo captions.
This function will split captions onto multiple lines if it detects
a "|" (pipe) symbol.
**********************************************
*/
/* Override existing caption shortcode handlers with our own */
add_shortcode(\'wp_caption\', \'multiline_caption\');
add_shortcode(\'caption\', \'multiline_caption\');
/* Our new function */
function multiline_caption($attr, $content = null) {
extract(shortcode_atts(array(
\'id\' => \'\',
\'align\' => \'alignnone\',
\'width\' => \'\',
\'caption\' => \'\'
), $attr));
if ( 1 > (int) $width || empty($caption) )
return $content;
if ( $id ) $id = \'id="\' . esc_attr($id) . \'" \';
$new_caption = str_replace("|", "<br />", $caption);
return \'<div \' . $id . \'class="wp-caption \' . esc_attr($align) . \'" style="width: \' . (10 + (int) $width) . \'px">\'
. do_shortcode( $content ) . \'<p class="wp-caption-text">\' . $new_caption . \'</p></div>\'; }
Mark Wood的原始代码:
http://digitalnotions.net/multi-line-captions-in-wordpress