-
Notifications
You must be signed in to change notification settings - Fork 800
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
Stats: Remove usage of create_function() in stats_convert_image_urls() #8240
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, but there's one thing that I'd love us to improve here.
modules/stats.php
Outdated
@@ -654,6 +654,11 @@ function stats_convert_image_urls( $html ) { | |||
return $html; | |||
} | |||
|
|||
function stats_convert_chart_urls_preg_replace_callback( $matches ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's namespace this with jetpack_
please. In order to make things easier, we can remove the _replace_callback
in the end and instead specify that this is going to be used as a callback inside a docblock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright! I guess I tried to name the function consistently with the way all of the functions are named without a jetpack_
prefix here. Will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in adfad17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Changelog 5.6: create base for changelog. * Update changelog with 5.5.1 info. * Changelog: add #7930 and #8238 * Changelog: add #8076 * Changelog: add #8100 * Changelog: add #8117 * Changelog: add #8141 * Changelog: add #8143 * Changelog: add #8147 * Changelog: add #8149 * Changelog: add #8153 * Changelog: add #8173 * Changelog: add #8184 * Changelog: add #8196 * Changelog: add #8199 * Changelog: add #8093 * Changelog: add #8171 * Changelog: add #8182 * Changelog: add #8202, #8222 * Changelog: add #8228 * Changelog: add #8240 * Changelog: add #8251 * remove AL card change
Fixes #8010
Changes proposed in this Pull Request:
create_function
for passing as callback topreg_replace_callback
. A new function calledstats_convert_chart_urls_preg_replace_callback
which does the same is introduced.Testing instructions:
WP_DEBUG
(and maybeWP_DEBUG_LOG
too) (/specialops
, can help)create_function
being deprecated.