Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
55620a4d
authored
2010-02-22 17:08:54 +0000
by
Chris Boden
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added add_filters function
1 parent
a60736c9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
tz-tools.php
tz-tools.php
View file @
55620a4
...
...
@@ -57,4 +57,16 @@ function add_shortcodes($class) {
add_shortcode
(
$method
->
name
,
Array
(
$class
,
$method
->
name
));
}
}
function
add_filters
(
$class
)
{
if
(
!
class_exists
(
$class
))
{
throw
new
Exception
(
"
$class
does not exist"
);
}
$ref
=
new
ReflectionClass
(
$class
);
$methods
=
$ref
->
getMethods
(
ReflectionMethod
::
IS_STATIC
);
foreach
(
$methods
as
$method
)
{
add_filter
(
$method
->
name
,
Array
(
$class
,
$method
->
name
));
}
}
?>
...
...
Please
register
or
sign in
to post a comment