-
Notifications
You must be signed in to change notification settings - Fork 228
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
Closes #264 #265
Closes #264 #265
Conversation
add_filter( 'wr2x_img_url', 'rocket_cdn_on_images_from_wp_retina_x2' ); | ||
function rocket_cdn_on_images_from_wp_retina_x2( $url ) { | ||
global $wr2x_admin; | ||
if ( $wr2x_admin->is_pro() ) { |
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.
Check before if the method exists with method_exists() function to avoid php error if the method doesn't exist in the future
*/ | ||
add_filter( 'wr2x_img_retina_url', '__rocket_cdn_on_images_from_wp_retina_x2' ); | ||
add_filter( 'wr2x_img_url', '__rocket_cdn_on_images_from_wp_retina_x2' ); | ||
function __rocket_cdn_on_images_from_wp_retina_x2( $url ) { |
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.
Don't forget to deprecated this function __rocket_cdn_on_images_from_wp_retina_x2() as it's renamed rocket_cdn_on_images_from_wp_retina_x2() without __ at the beginning
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.
A question about PHP7, if we add this function is the deprecated, it will still display an error because we will declare a function with double underscore?
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.
Most probably yes, we need to remove them all completely
Move WP Retina code to 3rd party and improve resilience