-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
/** | ||
* Class Image size API | ||
* | ||
* This class handle the image size in WordPress | ||
* | ||
* @link [URL] | ||
* @since 4.0.0 | ||
* | ||
* @package Italystrap | ||
*/ | ||
|
||
namespace ItalyStrap\Core\Image; | ||
|
||
/** | ||
* Class definition | ||
*/ | ||
class Size { | ||
|
||
/** | ||
* Default image size definitions | ||
* | ||
* @var array | ||
*/ | ||
private $default_image = array(); | ||
|
||
/** | ||
* Init the class | ||
* | ||
* @param [type] $argument [description]. | ||
*/ | ||
function __construct( array $theme_mods = array() ) { | ||
$this->theme_mods = $theme_mods; | ||
|
||
$this->default_image = array( | ||
'navbar-brand-image' => array( | ||
'width' => 45, | ||
'height' => 45, | ||
'crop' => true, | ||
), | ||
'full-width' => array( | ||
'width' => 1140, | ||
'height' => 9999, | ||
'crop' => false, | ||
), | ||
); | ||
} | ||
|
||
/** | ||
* Register image size | ||
*/ | ||
public function register() { | ||
|
||
foreach ( $this->default_image as $name => $params ) { | ||
add_image_size( | ||
$name, | ||
$params['width'], | ||
$params['height'], | ||
$params['crop'] | ||
); | ||
} | ||
|
||
} | ||
} |
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