Created
August 27, 2013 12:35
-
-
Save jonathandavis/6352946 to your computer and use it in GitHub Desktop.
A demo of a Shopp imaging module
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 | |
/** | |
* Imaging Addon Demo | |
* | |
* @author Jonathan Davis | |
* @copyright Ingenesis Limited, 2013 | |
* @package shopp | |
* @since 1.3 | |
* @version 1.0 | |
**/ | |
defined( 'WPINC' ) || header( 'HTTP/1.1 403' ) & exit; // Prevent direct access | |
class ShoppImagingAddonDemo implements ShoppImagingModule { | |
public function __construct () { | |
error_log(__CLASS__ . ' loaded.'); | |
add_filter('shopp_imageserver_request', array($this, 'request')); | |
add_filter('shopp_imageserver_parameters', array($this, 'parameters')); | |
add_action('shopp_imageserver_load', array($this, 'load')); | |
add_action('shopp_imageserver_preprocess', array($this, 'preprocess'), 10, 2); | |
add_action('shopp_imageserver_processed', array($this, 'processed'), 10, 2); | |
} | |
public function request ( $request ) { | |
error_log('IMAGE SERVER REQUEST: ' . $request); | |
return $request; | |
} | |
public function parameters ( $p ) { | |
error_log('IMAGE SERVER Parameters: ' . json_encode($p)); | |
return $p; | |
} | |
public function load ( $Image ) { | |
error_log('IMAGE SERVER load() Image: '. json_encode($Image)); | |
} | |
public function preprocess ( $Image, $parameters ) { | |
error_log('IMAGE SERVER preprocess() Image: '. json_encode($Image)); | |
error_log('IMAGE SERVER preprocess() parameters: '. json_encode($parameters)); | |
} | |
public function processed ( $Resized, $parameters ) { | |
error_log('IMAGE SERVER processed() Image: '. json_encode($Resized)); | |
error_log('IMAGE SERVER processed() parameters: '. json_encode($parameters)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment