Skip to content

Commit

Permalink
PLANET-5388 Fix author bio translation on Post and Author page
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarsdeshmukh committed Oct 20, 2020
1 parent 3857e2c commit c9e6ce7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions author.php
Expand Up @@ -34,7 +34,7 @@

$context['social_accounts'] = Post::filter_social_accounts( $context['footer_social_menu'] );
$context['og_title'] = $author->name . ' - ' . get_bloginfo( 'name' );
$context['og_description'] = $author->description;
$context['og_description'] = get_the_author_meta( 'description', $author->ID );
$context['og_image_data'] = [
'url' => get_avatar_url( $author->ID, [ 'size' => 300 ] ),
'width' => '300',
Expand All @@ -43,7 +43,7 @@

$author_share_buttons = new stdClass();
$author_share_buttons->title = $author->name;
$author_share_buttons->description = $author->description;
$author_share_buttons->description = get_the_author_meta( 'description', $author->ID );
$author_share_buttons->link = $author->link;
$context['author_share_buttons'] = $author_share_buttons;
}
Expand Down
7 changes: 4 additions & 3 deletions templates/blocks/author_profile.twig
Expand Up @@ -12,11 +12,12 @@
{% endset %}

{% set author_bio_char_limit = 180 %}
{% set post_author_description = fn('the_author_meta', 'description', post.author.id) %}

{% if ( post.author.description|length > author_bio_char_limit ) %}
{% set author_bio = fn('substr', post.author.description, 0, fn('strpos', post.author.description ,' ', author_bio_char_limit)) ~ author_bio_readmore %}
{% if ( post_author_description|length > author_bio_char_limit ) %}
{% set author_bio = fn('substr', post_author_description, 0, fn('strpos', post_author_description ,' ', author_bio_char_limit)) ~ author_bio_readmore %}
{% else %}
{% set author_bio = post.author.description %}
{% set author_bio = post_author_description %}
{% endif %}

<p class="author-block-info-bio" itemprop="description">
Expand Down

0 comments on commit c9e6ce7

Please sign in to comment.