Stats: Remove usage of create_function() in stats_convert_image_urls()#8240
Merged
dereksmart merged 2 commits intomasterfrom Nov 27, 2017
Merged
Stats: Remove usage of create_function() in stats_convert_image_urls()#8240dereksmart merged 2 commits intomasterfrom
dereksmart merged 2 commits intomasterfrom
Conversation
zinigor
previously requested changes
Nov 27, 2017
Contributor
zinigor
left a comment
There was a problem hiding this comment.
Looks good overall, but there's one thing that I'd love us to improve here.
modules/stats.php
Outdated
| return $html; | ||
| } | ||
|
|
||
| function stats_convert_chart_urls_preg_replace_callback( $matches ) { |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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.
oskosk
pushed a commit
that referenced
this pull request
Nov 28, 2017
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8010
Changes proposed in this Pull Request:
create_functionfor passing as callback topreg_replace_callback. A new function calledstats_convert_chart_urls_preg_replace_callbackwhich does the same is introduced.Testing instructions:
WP_DEBUG(and maybeWP_DEBUG_LOGtoo) (/specialops, can help)create_functionbeing deprecated.