You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really appreciate the warning message about using json_encode():
json_encode() is discouraged. Use wp_json_encode() instead.
(WordPress.WP.AlternativeFunctions.json_encode_json_encode)phpcs
I had no idea wp_trigger_error() even existed until I was reading the documentation for _doing_it_wrong(), yet it's exactly what I've been wanting and resolves the warnings.
Originally, I also had no idea about wp_json_encode() which is why I'm so thankful for the great messaging for that warning.
Tested Against develop Branch?
I have verified the issue still exists in the develop branch of WordPressCS.
I'm using the Composer global installation, so I'm not sure how to confirm this.
The text was updated successfully, but these errors were encountered:
Wasn't sure if this should be reported as a bug or feature request..?
Bug Description
The current warning message is vague and does not provide helpful recommendation:
Minimal Code Snippet
Error Code
Environment
Full version info of Visual Studio Code
Additional Context (optional)
I really appreciate the warning message about using
json_encode()
:I had no idea
wp_trigger_error()
even existed until I was reading the documentation for_doing_it_wrong()
, yet it's exactly what I've been wanting and resolves the warnings.Originally, I also had no idea about
wp_json_encode()
which is why I'm so thankful for the great messaging for that warning.Tested Against
develop
Branch?develop
branch of WordPressCS.The text was updated successfully, but these errors were encountered: