Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLANET-5388 Fix author bio translation on Post and Author page #1207

Merged
merged 1 commit into from Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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('get_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