Wordpress++

This commit is contained in:
nikolark committed 2015-08-22 18:55:55 +02:00
1 parent 790f1487a2
commit 3f49ab1747
610 files changed
+58979 -36562

No files matched your search

+25 -17
View File
@@ -31,11 +31,13 @@ abstract class WP_Image_Editor {
* Must be overridden in a sub-class.
*
* @since 3.5.0
*
* @static
* @access public
* @abstract
*
* @param array $args
* @return boolean
* @return bool
*/
public static function test( $args = array() ) {
return false;
@@ -46,11 +48,13 @@ abstract class WP_Image_Editor {
* Must be overridden in a sub-class.
*
* @since 3.5.0
*
* @static
* @access public
* @abstract
*
* @param string $mime_type
* @return boolean
* @return bool
*/
public static function supports_mime_type( $mime_type ) {
return false;
@@ -63,7 +67,7 @@ abstract class WP_Image_Editor {
* @access protected
* @abstract
*
* @return boolean|WP_Error True if loaded; WP_Error on failure.
* @return bool|WP_Error True if loaded; WP_Error on failure.
*/
abstract public function load();
@@ -93,8 +97,8 @@ abstract class WP_Image_Editor {
*
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param boolean $crop
* @return boolean|WP_Error
* @param bool $crop
* @return bool|WP_Error
*/
abstract public function resize( $max_w, $max_h, $crop = false );
@@ -131,8 +135,8 @@ abstract class WP_Image_Editor {
* @param int $src_h The height to crop.
* @param int $dst_w Optional. The destination width.
* @param int $dst_h Optional. The destination height.
* @param boolean $src_abs Optional. If the source crop points are absolute.
* @return boolean|WP_Error
* @param bool $src_abs Optional. If the source crop points are absolute.
* @return bool|WP_Error
*/
abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false );
@@ -144,7 +148,7 @@ abstract class WP_Image_Editor {
* @abstract
*
* @param float $angle
* @return boolean|WP_Error
* @return bool|WP_Error
*/
abstract public function rotate( $angle );
@@ -155,9 +159,9 @@ abstract class WP_Image_Editor {
* @access public
* @abstract
*
* @param boolean $horz Flip along Horizontal Axis
* @param boolean $vert Flip along Vertical Axis
* @return boolean|WP_Error
* @param bool $horz Flip along Horizontal Axis
* @param bool $vert Flip along Vertical Axis
* @return bool|WP_Error
*/
abstract public function flip( $horz, $vert );
@@ -169,7 +173,7 @@ abstract class WP_Image_Editor {
* @abstract
*
* @param string $mime_type
* @return boolean|WP_Error
* @return bool|WP_Error
*/
abstract public function stream( $mime_type = null );
@@ -226,7 +230,7 @@ abstract class WP_Image_Editor {
* @access public
*
* @param int $quality Compression Quality. Range: [1,100]
* @return boolean|WP_Error True if set successfully; WP_Error on failure.
* @return true|WP_Error True if set successfully; WP_Error on failure.
*/
public function set_quality( $quality = null ) {
if ( null === $quality ) {
@@ -344,7 +348,7 @@ abstract class WP_Image_Editor {
$info = pathinfo( $filename );
$dir = $info['dirname'];
if( isset( $info['extension'] ) )
if ( isset( $info['extension'] ) )
$ext = $info['extension'];
$filename = trailingslashit( $dir ) . wp_basename( $filename, ".$ext" ) . ".{$new_ext}";
@@ -406,7 +410,7 @@ abstract class WP_Image_Editor {
* @param string|stream $filename
* @param callable $function
* @param array $arguments
* @return boolean
* @return bool
*/
protected function make_image( $filename, $function, $arguments ) {
if ( $stream = wp_is_stream( $filename ) ) {
@@ -442,10 +446,12 @@ abstract class WP_Image_Editor {
* as mapped from wp_get_mime_types()
*
* @since 3.5.0
*
* @static
* @access protected
*
* @param string $extension
* @return string|boolean
* @return string|false
*/
protected static function get_mime_type( $extension = null ) {
if ( ! $extension )
@@ -468,10 +474,12 @@ abstract class WP_Image_Editor {
* as mapped from wp_get_mime_types()
*
* @since 3.5.0
*
* @static
* @access protected
*
* @param string $mime_type
* @return string|boolean
* @return string|false
*/
protected static function get_extension( $mime_type = null ) {
$extensions = explode( '|', array_search( $mime_type, wp_get_mime_types() ) );