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
aa34346a
authored
2011-02-28 02:13:12 +0000
by
Kevin Burton
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added TzOption Library in com
1 parent
165a93e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
com/TzOption/TzOption.php
com/TzOption/TzOption.php
0 → 100644
View file @
aa34346
<?php
namespace
Tz\WordPress\Tools\TzOption
;
use
Tz\WordPress\Tools
;
call_user_func
(
function
()
{
Tools\add_actions
(
__NAMESPACE__
.
'\Actions'
);
Tools\add_shortcodes
(
__NAMESPACE__
.
'\ShortCodes'
);
});
function
GetOption
(
$key
)
{
if
(
isset
(
Vars
::
$options
[
$key
]
)
)
{
return
Vars
::
$options
[
$key
];
}
else
{
return
'-'
;
}
}
class
Actions
{
public
static
function
init
()
{
global
$wpdb
;
$results
=
$wpdb
->
get_results
(
"SELECT * FROM wp_cbv_options"
,
ARRAY_A
);
foreach
(
$results
as
$key
=>
$val
)
{
Vars
::
$options
[
$key
]
=
$val
;
}
}
}
class
ShortCodes
{
public
static
function
TzOption
(
$args
,
$content
,
$tag
)
{
return
TzOption\GetOption
(
$args
[
'key'
]);
}
}
class
Vars
{
public
static
$options
=
array
();
}
?>
\ No newline at end of file
Please
register
or
sign in
to post a comment