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
5efbe65d
authored
2010-04-19 17:19:53 +0000
by
Chris Boden
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fixed bug in WP_Option
1 parent
db6017bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
lib/WP_Option.php
lib/WP_Option.php
View file @
5efbe65
...
...
@@ -11,15 +11,18 @@ class WP_Option implements ArrayAccess, Countable {
$this
->
_ns
=
$ns
;
$this
->
_data
=
get_option
(
$ns
);
$changed
=
false
;
if
(
is_array
(
$defaults
))
{
foreach
(
$this
->
_data
as
$key
=>
$val
)
{
$defaults
[
$key
]
=
$val
;
foreach
(
$defaults
as
$key
=>
$val
)
{
if
(
!
isset
(
$this
->
_data
[
$key
]))
{
$this
->
_data
[
$key
]
=
$val
;
$changed
=
true
;
}
}
}
if
(
$this
->
_data
!=
$defaults
)
{
$this
->
_data
=
$defaults
;
$this
->
save
();
}
if
(
$changed
)
{
$this
->
save
();
}
}
...
...
Please
register
or
sign in
to post a comment