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
2c940cfa
authored
2010-10-20 16:22:44 +0000
by
Chris Boden
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added new Short code helper functions
1 parent
25675ccf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
com/ShortCodes/ShortCodes.php
com/ShortCodes/ShortCodes.php
View file @
2c940cf
...
...
@@ -5,7 +5,7 @@ namespace Tz\WordPress\Tools\ShortCodes;
use
Tz\WordPress\Tools
;
use
ReflectionClass
,
ReflectionMethod
,
ReflectionFunction
;
use
Exception
;
use
Exception
,
Closure
;
call_user_func
(
function
()
{
Tools\add_actions
(
__NAMESPACE__
.
'\Actions'
);
...
...
@@ -46,6 +46,19 @@ function getFileContents($file) {
return
$parsed_contents
;
}
function
buffer
(
Closure
$cb
)
{
ob_start
();
$cb
();
$contents
=
ob_get_contents
();
ob_end_clean
();
return
$contents
;
}
function
dump
(
$var
)
{
return
'<pre>'
.
buffer
(
function
()
use
(
$var
)
{
print_r
(
$var
);
})
.
'</pre>'
;
}
function
registerClass
(
$class
)
{
call_user_func
(
__NAMESPACE__
.
'\add_shortcodes'
,
$class
);
}
...
...
Please
register
or
sign in
to post a comment