public
Description: Personal blog
Homepage: http://blog.alexgirard.com
Clone URL: git://github.com/alx/alexgirard.com-blog.git
100644 68 lines (61 sloc) 1.633 kb
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
<?php
 
/**
* check_input() - Checks input is of correct type
*
* Always returns true when WP_DEBUG is true, to allow for easier debugging
* in the development environment while handling erroneous input more
* robustly in the production environment.
* @see http://uk3.php.net/manual/en/function.gettype.php
* @since 2.1
* @param mixed $input
* @param string $type
* @param string $name
* @return boolean
*
*/
function check_input($input, $type, $name = '') {
if ( WP_DEBUG === true )
return true;
 
if ( $type == 'object' && strlen($name) > 0 )
return is_a($input, $name);
else
return call_user_func("is_$type", $input);
}
 
/**
* theme_version() - Returns the current theme version.
*
* @since 2.0
* @return string
*/
function theme_version() {
$themedata = get_theme_data(TEMPLATEPATH . '/style.css');
$version = trim($themedata['Version']);
 
if (strlen($version) > 0)
return $version;
}
 
/**
* detectWPMU() - Detects whether WordPress Multi-User is in use.
*
* @since 1.4
* @return boolean
*/
function detectWPMU() {
return function_exists('is_site_admin');
}
 
/**
* is_valid_tarski_style() - Checks whether a given file name is a valid Tarski stylesheet name.
*
* It must be a valid CSS identifier, followed by the .css file extension,
* and it cannot have a name that is already taken by Tarski's CSS namepsace.
* @since 2.0
* @param string $file
* @return boolean
*/
function is_valid_tarski_style($file) {
return (bool) (
!preg_match('/^\.+$/', $file)
&& preg_match('/^[A-Za-z][A-Za-z0-9\-]*.css$/', $file)
&& !preg_match('/^(janus|centre|rtl|js).css$/', $file)
);
}
 
?>