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

Closes #264 #265

Merged
merged 5 commits into from
Dec 23, 2016
Merged

Closes #264 #265

merged 5 commits into from
Dec 23, 2016

Conversation

remyperona
Copy link
Contributor

Move WP Retina code to 3rd party and improve resilience

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() ) {
Copy link
Contributor

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 ) {
Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

@remyperona remyperona merged commit 5564a7c into branch-2.9.1 Dec 23, 2016
@remyperona remyperona deleted the feature/2.9.1/wpretina-compatibility branch December 23, 2016 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants