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

Add defensive coding for wp_get_word_count_type #4030

Closed

Conversation

kraftbj
Copy link

@kraftbj kraftbj commented Feb 7, 2023

wp_trim_words can be called earlier in the stack than when the WP_Locale is currently set (during theme setup).

This adds some defensive coding to ensure a value is returned without a fatal error. The default value of words is used.

Trac ticket: https://core.trac.wordpress.org/ticket/56698


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@kraftbj kraftbj force-pushed the update/wp_get_word_count_type branch from 5339aed to 0352e89 Compare February 8, 2023 23:21
@SergeyBiryukov
Copy link
Member

Thanks for the PR! Merged in r55351 with some minor edits.

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