Skip to content

v1.303.0

Compare
Choose a tag to compare
@planet-4 planet-4 released this 02 Dec 10:21
· 31 commits to main since this release
PLANET-7482 Use proper function for displaying author bio

We are currently using [the_author_meta](https://developer.wordpress.org/reference/functions/the_author_meta/).
But the function doesn't return a string, which is what [wpautop](https://developer.wordpress.org/reference/functions/wpautop/) expects. This also triggers the following warning locally:

```
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/wp-includes/formatting.php on line 449
```

Instead, we should use [get_the_author_meta](https://developer.wordpress.org/reference/functions/get_the_author_meta/) as it's also mentioned in the documentation of `the_author_meta`:

>NOTE: Use `get_the_author_meta()` if you need to return (and do something with) the field, rather than just display it.

This also fixes bug [PLANET-7482](https://jira.greenpeace.org/browse/PLANET-7482).
So it includes some css changes to make the links also follow the correct design.

On the Authors block (Post view), when the bio is bigger than our character limit, the `wpautop` is not used
as it's hard to keep the formatting while breaking up the description text.