' . $posted_on . '
'; // WPCS: XSS OK.
}
}
endif;
if( !function_exists('ashlar_posted_by') ) :
/**
* Prints HTML with meta information for the current author.
*/
function ashlar_posted_by(){
$ashlar_default = ashlar_get_default_theme_options();
$ed_post_author = absint( get_theme_mod( 'ed_post_author',$ashlar_default['ed_post_author'] ) );
if( $ed_post_author ){
echo '';
/* translators: 1: list of categories. */
foreach( $categories as $category ){
$cat_name = $category->name;
$cat_slug = $category->slug;
$cat_url = get_category_link( $category->term_id ); ?>
';
}
if( $tags && $ed_post_tags ){
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list('', esc_html_x(', ', 'list item separator', 'ashlar'));
if( $tags_list ){
echo '
';
echo ' ';
ashlar_the_theme_svg('tag');
echo '';
echo '';
esc_html_e('In', 'ashlar');
echo '';
/* translators: 1: list of tags. */
echo '';
echo wp_kses_post($tags_list) . ''; // WPCS: XSS OK.
echo '
';
}
}
if( $edits ){
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__('Edit
%s', 'ashlar'),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
),
'
',
''
);
}
}
}
endif;
if( !function_exists('ashlar_is_comment_by_post_author') ):
/**
* Comments
*/
/**
* Check if the specified comment is written by the author of the post commented on.
*
* @param object $comment Comment data.
*
* @return bool
*/
function ashlar_is_comment_by_post_author( $comment = null ){
if( is_object($comment) && $comment->user_id > 0 ){
$user = get_userdata($comment->user_id);
$post = get_post($comment->comment_post_ID);
if (!empty($user) && !empty($post)) {
return $comment->user_id === $post->post_author;
}
}
return false;
}
endif;
add_filter( 'get_the_archive_title','ashlar_archive_title_callback');
if( !function_exists('ashlar_archive_title_callback') ) :
/**
* Ashlar Archive title filter
*/
function ashlar_archive_title_callback($comment = null){
$title = '';
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
} elseif ( is_author() ) {
$title = get_the_author();
} elseif ( is_year() ) {
$title = get_the_date( 'Y' );
} elseif ( is_month() ) {
$title = get_the_date( 'F Y' );
} elseif ( is_day() ) {
$title = get_the_date( 'F j, Y' );
} elseif ( is_post_type_archive() ) {
$title = post_type_archive_title( '', false );
} elseif ( is_tax() ) {
$title = single_term_title( '', false );
}
return $title;
}
endif;
if( !function_exists('ashlar_archive_title') ) :
/**
* Ashlar Breadcrumb
*/
function ashlar_archive_title($comment = null){
if( is_search() ){ ?>
';
breadcrumb_trail();
echo '
';
}
endif;