Created
May 26, 2020 13:40
-
-
Save korynorthrop/470293b1f7126207f31a3fdc5cc5428e to your computer and use it in GitHub Desktop.
Autoptimize RTL filter
This file contains 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
<?php | |
public function rtl_logic( $input_condition ) { | |
if ( is_rtl() || strpos( $_SERVER['REQUEST_URI'], '/ar/' ) !== false || strpos( $_SERVER['REQUEST_URI'], '/he/' ) !== false || strpos( $_SERVER['REQUEST_URI'], '/fa/' ) !== false || strpos( $_SERVER['REQUEST_URI'], '/ur/' ) !== false ) { | |
error_log( "path-based rule set for: " . $_SERVER['REQUEST_URI'] ); | |
return true; | |
} else { | |
error_log( "conditional tag used for: " . $_SERVER['REQUEST_URI'] ); | |
if ( is_single() ) { | |
error_log( "and is_single() is true for: " . $_SERVER['REQUEST_URI'] ); | |
} | |
return $input_condition; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment