-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions-source-lists.php
43 lines (37 loc) · 1.02 KB
/
functions-source-lists.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
40
41
42
43
<?php
/**
* Source list functionality.
*
* @package Respect_Art_Direction
*/
/**
* Register a new source list.
*
* @param string $source_list_name Name of a source list.
* @param array $image_sizes List of image sizes for the source list.
*/
function rad_add_source_list( $source_list_name, $image_sizes = array() ) {
global $rad_source_lists;
$rad_source_lists[ $source_list_name ] = $image_sizes;
}
/**
* Add an image size to a source list.
*
* @param string $source_list_name Source list name.
* @param string $image_size Image size name.
*/
function rad_add_to_source_list( $source_list_name, $image_size ) {
global $rad_source_lists;
$rad_source_lists[ $source_list_name ][] = $image_size;
}
/**
* Checks if an image size is a registered image source.
*
* @param string $image_size Image size name to check.
*
* @return bool Whether the image size is a source.
*/
function rad_image_size_is_image_source( $image_size ) {
global $rad_source_lists;
return isset( $rad_source_lists[ $image_size ] );
}