Changeset 2279493
- Timestamp:
- 04/08/2020 04:51:54 PM (6 years ago)
- Location:
- image-cdn/trunk
- Files:
-
- 3 edited
-
image-cdn.php (modified) (1 diff)
-
imageengine/class-imagecdn.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
image-cdn/trunk/image-cdn.php
r2267011 r2279493 7 7 * Author URI: https://imageengine.io/ 8 8 * License: GPLv2 or later 9 * Version: 1.0. 09 * Version: 1.0.1 10 10 */ 11 11 -
image-cdn/trunk/imageengine/class-imagecdn.php
r2267011 r2279493 25 25 */ 26 26 public function __construct() { 27 // Rewriter hook. 28 add_action( 'template_redirect', array( self::class, 'handle_rewrite_hook' ) ); 29 30 // Rewrite rendered content in REST API. 31 add_filter( 'the_content', array( self::class, 'rewrite_the_content' ), 100 ); 32 33 // Resource hints. 34 add_action( 'wp_head', array( self::class, 'add_head_tags' ), 0 ); 27 28 // Only enable the hooks if the configuration is valid and the plugin is enabled. 29 if ( self::should_rewrite() ) { 30 // Rewriter hook. 31 add_action( 'template_redirect', array( self::class, 'handle_rewrite_hook' ) ); 32 33 // Rewrite rendered content in REST API. 34 add_filter( 'the_content', array( self::class, 'rewrite_the_content' ), 100 ); 35 36 // Resource hints. 37 add_action( 'wp_head', array( self::class, 'add_head_tags' ), 0 ); 38 } 35 39 36 40 // Hooks. … … 47 51 */ 48 52 public static function add_head_tags() { 49 if ( ! self::should_rewrite() ) {50 return;51 }52 53 53 // Add client hints. 54 54 echo ' <meta http-equiv="Accept-CH" content="DPR, Viewport-Width, Width, Save-Data">' . "\n"; … … 209 209 */ 210 210 public static function handle_rewrite_hook() { 211 if ( ! self::should_rewrite() ) {212 return false;213 }214 215 211 $rewriter = self::get_rewriter(); 216 212 ob_start( array( $rewriter, 'rewrite' ) ); … … 223 219 */ 224 220 public static function rewrite_the_content( $html ) { 225 if ( ! self::should_rewrite() ) {226 return false;227 }228 229 221 $rewriter = self::get_rewriter(); 230 222 return $rewriter->rewrite( $html ); -
image-cdn/trunk/readme.txt
r2267011 r2279493 72 72 == Changelog == 73 73 74 = 1.0.1 = 75 * Fixed issue with blank content rendering 76 77 = 1.0.0 = 78 * Initial stable release 79 74 80 = 0.9.0 = 75 81 * Initial beta release
Note: See TracChangeset
for help on using the changeset viewer.