-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.txt
108 lines (72 loc) · 2.4 KB
/
readme.txt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
=== BF Advanced Images ===
Contributors: jmucak
Donate link: /
Tags: advanced images, images, bf, custom images
Requires at least: 4.7
Tested up to: 6.1.1
Stable tag: 1.0.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Create images on demand
== Description ==
With this plugin you can create images on demand. You can disable default image sizes so
each image you upload won't be copied multiple times with different size. You can create your sizes for images and
size will be created when you call image and not on upload.
== Installation ==
Upload 'bf-advanced-images' to the '/wp-content/plugins/' directory
Activate the plugin through the 'Plugins' menu in WordPress
= How this plugin works =
1. Removing default image sizes
You can disable default image sizes so when uploading an image only original image will be uploaded
2. Adding new cached image sizes
You can create as many image size you want and only when you use this image size image with this size will be created.
`
if ( function_exists( 'bfai_register_image_sizes' ) ) {
bfai_register_image_sizes( array(
'image_200' => array( 200, 0 ),
'image_350_200' => array( 350, 200 ),
'image_150_200' => array( 150, 200 ),
) );
}
`
3. Creating image sizes on demand
When image is called it will generate image size for that image
Example 1:
*bfai_get_image_by_size_name( int $attachment_id, string $size_name, bool $crop = false);*
Parameters:
**$attachment_id**
(int)(required)
**$size_name**
(string)(required) -> name of size name registered with bfai_register_image_sizes function
**$crop**
(bool)(optional)
`
$image_url = bfai_get_image_by_size_name( $attachment_id, 'image_200', true);
`
Example 2:
*bfai_get_image_by_custom_size( int $attachment_id, array $sizes, bool $crop = false);*
Parameters:
**$attachment_id**
(int)(required)
**$sizes**
(array)(required) -> Add integer width and height separated with comma
**$crop**
(bool)(optional)
`
$image_url = bfai_get_image_by_custom_size( $attachment_id, array( 200, 0 ), true );
`
== Screenshots ==
== Frequently Asked Questions ==
= What kind of support do you provide? =
Please post your question on plugin support forum
== Upgrade Notice ==
= 1.0.0 =
First Release
== Changelog ==
= 1.0.0 =
*Release Date - 27 October 2021*
First Release
= 1.0.1 =
*Release Date - 22 November 2021*
* New - Added WP CLI Commands