Ejemplo n.º 1
0
/**
 * Filter the_content for post formats, and add extra presentational markup as needed.
 *
 * @param string $the_content
 * @return string Updated content with extra markup.
 */
function esquire_the_content($content)
{
    if (has_post_format('image')) {
        $first_image = esquire_image_grabber(get_the_ID(), $content, '<div class="frame"><div class="wrapper">', '</div></div>');
        if ($first_image && defined('WPCOM_THEMES_IMAGE_REPLACE_REGEX')) {
            $content = preg_replace(WPCOM_THEMES_IMAGE_REPLACE_REGEX, $first_image, $content, 1);
        }
    }
    return $content;
}
Ejemplo n.º 2
0
/**
 * Filter the_content for post formats, and add extra presentational markup as needed.
 *
 * @param string the_content
 * @return string Updated content with extra markup.
 */
function esquire_the_content( $content ) {
	global $post;
	$format = get_post_format();
	if ( ! $format )
		return $content;

	switch ( $format ) {
		case 'image':
			$first_image = esquire_image_grabber( $post->ID, $content, '<div class="frame"><div class="wrapper">', '</div></div>' );
			if ( $first_image )
				$content = preg_replace( WPCOM_THEMES_IMAGE_REPLACE_REGEX, $first_image, $content, 1 );
			break;
		default:
			break;
	}

	return $content;
}