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

Descriptions and og:descriptions might be shorter than expected #11598

Open
afercia opened this issue Nov 14, 2018 · 0 comments
Open

Descriptions and og:descriptions might be shorter than expected #11598

afercia opened this issue Nov 14, 2018 · 0 comments

Comments

@afercia
Copy link
Contributor

afercia commented Nov 14, 2018

Noticed while checking #11578

Consider this bit of code:

$replacement = wp_html_excerpt( $content, 156 );
// Trim the auto-generated string to a word boundary.
$replacement = substr( $replacement, 0, strrpos( $replacement, ' ' ) );

and consider a post content where a word ends exactly at the 156th character:

As a consequence, words that end exactly at the 156th character will always be stripped out. I guess for this to work we should pass a string which is 158 characters long?

/Cc @moorscode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants