-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass-flexi-media.php
39 lines (32 loc) · 1.08 KB
/
class-flexi-media.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Handle all media settings
*
* @link https://odude.com/
* @since 1.0.0
* @author ODude <[email protected]>
* @package Flexi
* @subpackage Flexi/includes
*/
class Flexi_Media_Settings {
public function __construct() {
add_action('after_setup_theme', array($this, 'custom_image'));
//
}
public function custom_image() {
$t_width = flexi_get_option('t_width', 'flexi_media_settings', 150);
$t_height = flexi_get_option('t_height', 'flexi_media_settings', 150);
$m_width = flexi_get_option('m_width', 'flexi_media_settings', 300);
$m_height = flexi_get_option('m_height', 'flexi_media_settings', 300);
$l_width = flexi_get_option('l_width', 'flexi_media_settings', 1024);
$l_height = flexi_get_option('l_height', 'flexi_media_settings', 1024);
if (flexi_get_option('crop_thumbnail', 'flexi_media_settings', 0) == 0) {
$crop = false;
} else {
$crop = true;
}
add_image_size('flexi-thumb', $t_width, $t_width, $crop);
add_image_size('flexi-medium', $m_width, $m_width);
add_image_size('flexi-large', $l_width, $l_width);
}
}