(.*?)<\/code>/ims', create_function (
'$matches',
'$matches[2] = preg_replace( array("/^[\r|\n]+/i", "/[\r|\n]+$/i"), "", $matches[2] ); return "" . esc_html( $matches[2] ) . "";' ), $source );
if ( $encoded )
{
return $encoded;
}
else
{
return $source;
}
}
add_filter( 'the_content', 'aemi_escape_code_fragments' );
add_filter( 'pre_comment_content', 'aemi_escape_code_fragments' );
if ( ! function_exists( 'aemi_custom_archive_title' ) )
{
function aemi_custom_archive_title( $title )
{
if ( is_category() ) {
$title = '
' . single_cat_title( '', false ) . '
' . _x( 'Category', 'archive page type category', 'aemi' ) . '
';
} elseif ( is_tag() ) {
$title = '' . single_tag_title( '', false ) . '
' . _x( 'Tag', 'archive page type tag', 'aemi' ) . '
';
} elseif ( is_author() ) {
$title = '' . get_the_author() . '
' . _x( 'Author', 'archive page type author', 'aemi' ) . '
';
} elseif ( is_year() ) {
$title = '' . get_the_date( 'Y' ) . '
' . _x( 'Yearly Archives', 'archive page type yearly', 'aemi' ) . '
';
} elseif ( is_month() ) {
$title = '' . get_the_date( 'F Y' ) . '
' . _x( 'Monthly Archives', 'archive page type monthly', 'aemi' ) . '
';
} elseif ( is_day() ) {
$title = '' . get_the_date( 'j F Y' ) . '
' . _x( 'Daily Archives', 'archive page type daily', 'aemi' ) . '
';
} elseif ( is_tax( 'post_format' ) ) {
if ( is_tax( 'post_format', 'post-format-aside' ) ) {
$title = '' . _x( 'Asides', 'post format archive title', 'aemi' ) . '
';
} elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {
$title = '' . _x( 'Galleries', 'post format archive title', 'aemi' ) . '
';
} elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
$title = '' . _x( 'Images', 'post format archive title', 'aemi' ) . '
';
} elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
$title = '' . _x( 'Videos', 'post format archive title', 'aemi' ) . '
';
} elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
$title = '' . _x( 'Quotes', 'post format archive title', 'aemi' ) . '
';
} elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
$title = '' . _x( 'Links', 'post format archive title', 'aemi' ) . '
';
} elseif ( is_tax( 'post_format', 'post-format-status' ) ) {
$title = '' . _x( 'Status', 'post format archive title', 'aemi' ) . '
';
} elseif ( is_tax( 'post_format', 'post-format-audio' ) ) {
$title = '' . _x( 'Audio', 'post format archive title', 'aemi' ) . '
';
} elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
$title = '' . _x( 'Chats', 'post format archive title', 'aemi' ) . '
';
}
} elseif ( is_post_type_archive() ) {
$title = '' . post_type_archive_title( '', false ) . '
';
} elseif ( is_tax() ) {
$tax = get_taxonomy( get_queried_object()->taxonomy );
$title = '' . single_term_title( '', false ) . '
' . $tax->labels->singular_name . '
';
} else {
$title = '' . _x( 'Archives', 'generic archive title', 'aemi' ) . '
';
}
return $title;
}
}
add_filter( 'get_the_archive_title', 'aemi_custom_archive_title' );