first commit
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
@@ -0,0 +1,568 @@
|
||||
/* --------------------------------------------------
|
||||
:: OptionTree Font
|
||||
---------------------------------------------------*/
|
||||
.ui-tabs li > a [class^="ot-icon-"],
|
||||
.ui-tabs li > a [class*=" ot-icon-"] {
|
||||
display: block;
|
||||
height: 14px;
|
||||
float: right;
|
||||
padding: 2px 0px 0 9px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Messages
|
||||
---------------------------------------------------*/
|
||||
.wrap.settings-wrap div.error,
|
||||
.wrap.settings-wrap div.updated {
|
||||
margin: 9px 2px 0px 5px !important;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: OptionTree Wrappers
|
||||
---------------------------------------------------*/
|
||||
#option-tree-settings-api > .ui-tabs {
|
||||
margin: 0px 2px 0 5px;
|
||||
-webkit-box-shadow: inset -146px 0 0 #f1f1f1, inset -147px 0 0 #ccc, 0 1px 3px rgba(0,0,0,0.05);
|
||||
-moz-box-shadow: inset -146px 0 0 #f1f1f1, inset -147px 0 0 #ccc, 0 1px 3px rgba(0,0,0,0.05);
|
||||
box-shadow: inset -146px 0 0 #f1f1f1, inset -147px 0 0 #ccc, 0 1px 3px rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Header
|
||||
---------------------------------------------------*/
|
||||
#option-tree-header {
|
||||
margin: 11px 2px 0 5px;
|
||||
}
|
||||
#option-tree-header li {
|
||||
float: right;
|
||||
}
|
||||
#option-tree-header #option-tree-logo a {
|
||||
border-right: 0;
|
||||
border-left: 1px solid #333;
|
||||
float: right;
|
||||
padding: 3px 13px 3px 12px;
|
||||
}
|
||||
#option-tree-header li#option-tree-logo:hover {
|
||||
-webkit-border-top-right-radius: 2px;
|
||||
-moz-border-radius-topright: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
}
|
||||
#option-tree-header #option-tree-version span,
|
||||
#option-tree-header #theme-version span {
|
||||
border-left: 0;
|
||||
border-right: 1px solid #555;
|
||||
float: left;
|
||||
}
|
||||
#option-tree-header #theme-version:before {
|
||||
border-right: 0;
|
||||
border-left: 1px solid #333;
|
||||
float: right;
|
||||
}
|
||||
/* light */
|
||||
.admin-color-light #option-tree-header #option-tree-logo a,
|
||||
.admin-color-light #option-tree-header #theme-version:before {
|
||||
border-left-color: #3c3c3c;
|
||||
}
|
||||
.admin-color-light #option-tree-header li#option-tree-logo:hover a {
|
||||
border-left-color: #3c3c3c;
|
||||
}
|
||||
.admin-color-light #option-tree-header #option-tree-version span,
|
||||
.admin-color-light #option-tree-header #theme-version span {
|
||||
border-right-color: #999;
|
||||
}
|
||||
/* blue */
|
||||
.admin-color-blue #option-tree-header #option-tree-logo a,
|
||||
.admin-color-blue #option-tree-header #theme-version:before {
|
||||
border-left-color: #002b39;
|
||||
}
|
||||
.admin-color-blue #option-tree-header li#option-tree-logo:hover a {
|
||||
border-left-color: #002b39;
|
||||
}
|
||||
.admin-color-blue #option-tree-header #option-tree-version span,
|
||||
.admin-color-blue #option-tree-header #theme-version span {
|
||||
border-right-color: #5dc2e6;
|
||||
}
|
||||
/* coffee */
|
||||
.admin-color-coffee #option-tree-header #option-tree-logo a,
|
||||
.admin-color-coffee #option-tree-header #theme-version:before {
|
||||
border-left-color: #0f0e0d;
|
||||
}
|
||||
.admin-color-coffee #option-tree-header li#option-tree-logo:hover a {
|
||||
border-left-color: #0f0e0d;
|
||||
}
|
||||
.admin-color-coffee #option-tree-header #option-tree-version span,
|
||||
.admin-color-coffee #option-tree-header #theme-version span {
|
||||
border-right-color: #675f58;
|
||||
}
|
||||
/* ectoplasm */
|
||||
.admin-color-ectoplasm #option-tree-header #option-tree-logo a,
|
||||
.admin-color-ectoplasm #option-tree-header #theme-version:before {
|
||||
border-left-color: #181220;
|
||||
}
|
||||
.admin-color-ectoplasm #option-tree-header li#option-tree-logo:hover a {
|
||||
border-left-color: #181220;
|
||||
}
|
||||
.admin-color-ectoplasm #option-tree-header #option-tree-version span,
|
||||
.admin-color-ectoplasm #option-tree-header #theme-version span {
|
||||
border-right-color: #644d85;
|
||||
}
|
||||
/* midnight */
|
||||
.admin-color-midnight #option-tree-header #option-tree-logo a,
|
||||
.admin-color-midnight #option-tree-header #theme-version:before {
|
||||
border-left-color: #090a0b;
|
||||
}
|
||||
.admin-color-midnight #option-tree-header li#option-tree-logo:hover a {
|
||||
border-left-color: #090a0b;
|
||||
}
|
||||
.admin-color-midnight #option-tree-header #option-tree-version span,
|
||||
.admin-color-midnight #option-tree-header #theme-version span {
|
||||
border-right-color: #4c5359;
|
||||
}
|
||||
/* ocean */
|
||||
.admin-color-ocean #option-tree-header #option-tree-logo a,
|
||||
.admin-color-ocean #option-tree-header #theme-version:before {
|
||||
border-left-color: #39464a;
|
||||
}
|
||||
.admin-color-ocean #option-tree-header li#option-tree-logo:hover a {
|
||||
border-left-color: #39464a;
|
||||
}
|
||||
.admin-color-ocean #option-tree-header #option-tree-version span,
|
||||
.admin-color-ocean #option-tree-header #theme-version span {
|
||||
border-right-color: #87a6af;
|
||||
}
|
||||
/* sunrise */
|
||||
.admin-color-sunrise #option-tree-header #option-tree-logo a,
|
||||
.admin-color-sunrise #option-tree-header #theme-version:before {
|
||||
border-left-color: #8a322a;
|
||||
}
|
||||
.admin-color-sunrise #option-tree-header li#option-tree-logo:hover a {
|
||||
border-left-color: #8a322a;
|
||||
}
|
||||
.admin-color-sunrise #option-tree-header #option-tree-version span,
|
||||
.admin-color-sunrise #option-tree-header #theme-version span {
|
||||
border-right-color: #e75546;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Sub Header
|
||||
---------------------------------------------------*/
|
||||
#option-tree-sub-header {
|
||||
margin: 0 2px 0 5px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Tabs
|
||||
---------------------------------------------------*/
|
||||
.wrap.settings-wrap .ui-tabs-nav {
|
||||
float: right;
|
||||
margin: 0 -4px 0 0;
|
||||
}
|
||||
.wrap.settings-wrap .ui-tabs-nav li {
|
||||
border-left-width: 0;
|
||||
border-right-width: 1px;
|
||||
-webkit-border-radius: 0 2px 2px 0;
|
||||
-moz-border-radius: 0 2px 2px 0;
|
||||
border-radius: 0 2px 2px 0;
|
||||
}
|
||||
.wrap.settings-wrap .ui-tabs-nav li a {
|
||||
padding: 5px 12px 5px 5px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Format Setting
|
||||
---------------------------------------------------*/
|
||||
.format-setting .format-setting-inner {
|
||||
float: right;
|
||||
}
|
||||
.format-setting .description {
|
||||
float: left;
|
||||
}
|
||||
#post .format-setting-inner p {
|
||||
float: right;
|
||||
}
|
||||
.docs-ul li {
|
||||
margin-left: 0;
|
||||
margin-right: 20px;
|
||||
}
|
||||
#contextual-help-setting {
|
||||
float: right;
|
||||
}
|
||||
#contextual-help-label {
|
||||
float: right;
|
||||
}
|
||||
#option_tree_settings_help {
|
||||
float: right;
|
||||
}
|
||||
#option-tree-settings-api blockquote {
|
||||
padding-left: 0;
|
||||
padding-right: 15px;
|
||||
}
|
||||
#option-tree-settings-api blockquote:before {
|
||||
left: auto;
|
||||
right: -10px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Input & Upload
|
||||
---------------------------------------------------*/
|
||||
input.option-tree-ui-upload-input,
|
||||
input.option-tree-ui-input {
|
||||
-moz-box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
-webkit-box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.option-tree-sortable input.option-tree-ui-upload-input,
|
||||
.option-tree-sortable input.option-tree-ui-input {
|
||||
width: 99.9%; /* fixes a strange bug with input with */
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Upload
|
||||
---------------------------------------------------*/
|
||||
div.option-tree-ui-media-wrap {
|
||||
margin: 5px 0 0 55px;
|
||||
}
|
||||
.option-tree-ui-media-wrap img {
|
||||
float: right;
|
||||
}
|
||||
.option-tree-ui-upload-parent {
|
||||
margin-right: 0;
|
||||
margin-left: 45px;
|
||||
}
|
||||
.format-setting .ot_upload_media {
|
||||
right: auto;
|
||||
left: -45px;
|
||||
}
|
||||
.option-tree-ui-media-wrap a.option-tree-ui-remove-media {
|
||||
right: auto;
|
||||
left: -55px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Setting Item with Drag & Drop
|
||||
---------------------------------------------------*/
|
||||
.option-tree-setting .open {
|
||||
padding: 10px 10px 10px 100px;
|
||||
}
|
||||
.option-tree-setting .open:hover:before {
|
||||
left: auto;
|
||||
right: 4px;
|
||||
}
|
||||
.button-section {
|
||||
right: auto;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Layouts
|
||||
---------------------------------------------------*/
|
||||
#option-tree-options-layouts-form {
|
||||
left: auto;
|
||||
right: 13px;
|
||||
}
|
||||
.option-tree-save-layout {
|
||||
float: right;
|
||||
}
|
||||
.option-tree-save-layout.active-layout {
|
||||
border-left: 0;
|
||||
border-right: 1px solid #fff;
|
||||
padding-left: 0;
|
||||
padding-right: 9px;
|
||||
}
|
||||
.option-tree-save-layout .widefat {
|
||||
float: right;
|
||||
}
|
||||
.option-tree-save-layout button.blue {
|
||||
margin: 0 10px 0 0;
|
||||
}
|
||||
.option-tree-active-layout {
|
||||
border-right: 0;
|
||||
border-left: 1px solid #ccc;
|
||||
float: right;
|
||||
padding: 10px 0 10px 10px;
|
||||
}
|
||||
.button.save-layout {
|
||||
margin: 0 10px 0 0 !important;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Option Group
|
||||
---------------------------------------------------*/
|
||||
.ot-option-group {
|
||||
float: right;
|
||||
padding-right: 0px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.ot-option-group--is-last {
|
||||
padding-left: 0;
|
||||
}
|
||||
.ot-option-group--icon {
|
||||
border-left: 1px solid #ccc;
|
||||
border-right: 0px;
|
||||
left: auto;
|
||||
right: 1px;
|
||||
}
|
||||
.ot-option-group--icon + input.option-tree-ui-input {
|
||||
padding-left: 5px !important;
|
||||
padding-right: 34px !important;
|
||||
margin-left: 5px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
.ot-option-group--checkbox {
|
||||
float: right;
|
||||
padding-right: 0px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
#post-body .ot-option-group--checkbox p {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Select
|
||||
---------------------------------------------------*/
|
||||
.select-wrapper {
|
||||
background: #fff url(../images/ot-select-rtl.png) no-repeat left center;
|
||||
float: right;
|
||||
margin: 0 0 5px 5px;
|
||||
-moz-box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
-webkit-box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.select-wrapper:hover {
|
||||
background-image: url(../images/ot-select-hover-rtl.png);
|
||||
}
|
||||
.select-wrapper span {
|
||||
padding-left: 27px;
|
||||
padding-right: 7px;
|
||||
}
|
||||
.type-measurement .select-wrapper {
|
||||
margin-left: 0;
|
||||
right: auto;
|
||||
left: 0px;
|
||||
}
|
||||
/* FireFox */
|
||||
@-moz-document url-prefix() {
|
||||
#option-tree-options-layouts-form .select-wrapper {
|
||||
left: auto;
|
||||
right: 250px;
|
||||
};
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Measurement
|
||||
---------------------------------------------------*/
|
||||
.option-tree-ui-measurement-input-wrap {
|
||||
margin-right: 0;
|
||||
margin-left: 80px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Checkbox & Radio
|
||||
---------------------------------------------------*/
|
||||
.format-setting.type-checkbox input,
|
||||
.format-setting.type-radio input {
|
||||
float: right;
|
||||
margin: 2px 1px 0 5px;
|
||||
}
|
||||
.format-setting.type-checkbox label,
|
||||
.format-setting.type-radio label {
|
||||
float: right;
|
||||
}
|
||||
#option-tree-settings-api .format-setting.type-checkbox p,
|
||||
#option-tree-settings-api .format-setting.type-radio p {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Radio Images
|
||||
---------------------------------------------------*/
|
||||
.type-radio-image .option-tree-ui-radio-images {
|
||||
float: right;
|
||||
margin: 0 0px 10px 10px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Numeric Slider
|
||||
---------------------------------------------------*/
|
||||
.ot-numeric-slider-wrap {
|
||||
margin: 0 0 0 96px;
|
||||
}
|
||||
.ot-numeric-slider-wrap .ot-numeric-slider-helper-input {
|
||||
right: auto;
|
||||
left: 5px;
|
||||
}
|
||||
.ot-numeric-slider.ui-slider {
|
||||
-webkit-box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Colorpicker
|
||||
---------------------------------------------------*/
|
||||
.option-tree-ui-colorpicker-input-wrap {
|
||||
float: right;
|
||||
}
|
||||
.option-tree-ui-colorpicker-input-wrap .option-tree-ui-colorpicker-label {
|
||||
margin-left: 10px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
.type-link-color .option-tree-ui-colorpicker-input-wrap {
|
||||
margin-left: 20px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
.option-tree-ui-colorpicker-input-wrap .wp-color-result {
|
||||
margin: 0px 0px 5px 5px;
|
||||
}
|
||||
.option-tree-ui-colorpicker-input-wrap .wp-picker-container .iris-picker {
|
||||
margin: 0px 0px 5px 5px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Google Font
|
||||
---------------------------------------------------*/
|
||||
.js-remove-google-font.option-tree-ui-button.button {
|
||||
margin-left: 5px;
|
||||
margin-right: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: OptionTree UI Buttons
|
||||
---------------------------------------------------*/
|
||||
.option-tree-ui-button {
|
||||
float: right !important;
|
||||
}
|
||||
.option-tree-ui-button.right {
|
||||
float: left !important;
|
||||
}
|
||||
.option-tree-ui-button.hug-left {
|
||||
margin-right: 0px;
|
||||
}
|
||||
.option-tree-ui-button.hug-right {
|
||||
margin-left: 0px;
|
||||
}
|
||||
.option-tree-ui-button.left-item {
|
||||
float: right !important;
|
||||
margin: 5px 5px 5px 0;
|
||||
-webkit-border-radius: 0px 2px 2px 0px;
|
||||
-moz-border-radius: 0px 2px 2px 0px;
|
||||
border-radius: 0px 2px 2px 0px;
|
||||
}
|
||||
.option-tree-ui-button.center-item {
|
||||
margin: 5px -1px 5px 0;
|
||||
}
|
||||
.option-tree-ui-button.right-item {
|
||||
float: left !important;
|
||||
margin: 5px -1px 5px 5px;
|
||||
-webkit-border-radius: 2px 0px 0px 2px;
|
||||
-moz-border-radius: 2px 0px 0px 2px;
|
||||
border-radius: 2px 0px 0px 2px;
|
||||
}
|
||||
.option-tree-ui-buttons {
|
||||
margin: 11px 2px 0 5px;
|
||||
}
|
||||
button.reset-settings {
|
||||
left: auto;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: OptionTree UI Button Icons
|
||||
---------------------------------------------------*/
|
||||
.option-tree-ui-button .icon {
|
||||
float: right;
|
||||
text-indent: 0;
|
||||
}
|
||||
.option-tree-ui-button .icon.left-label {
|
||||
margin-left: 10px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Gallery
|
||||
---------------------------------------------------*/
|
||||
ul.ot-gallery-list {
|
||||
float: right;
|
||||
}
|
||||
ul.ot-gallery-list li {
|
||||
float: right;
|
||||
margin: 0px 0 10px 10px;
|
||||
}
|
||||
.ot-gallery-buttons {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Google Fonts
|
||||
---------------------------------------------------*/
|
||||
.option-tree-google-font-family,
|
||||
.option-tree-google-font-variants,
|
||||
.option-tree-google-font-subsets,
|
||||
#option-tree-settings-api p.checkbox-wrap,
|
||||
#post-body .ot-metabox-panels p.checkbox-wrap {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: On/Off Switch
|
||||
---------------------------------------------------*/
|
||||
@media only screen {
|
||||
.on-off-switch {
|
||||
-webkit-box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset -1px 1px 1px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.on-off-switch label {
|
||||
float: right;
|
||||
}
|
||||
.on-off-switch .slide-button {
|
||||
left: auto;
|
||||
right: -1px;
|
||||
}
|
||||
.on-off-switch input:last-of-type:checked ~ .slide-button {
|
||||
left: auto;
|
||||
right: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @hu_custom
|
||||
* Hueman doesn't need date and time picker jquery plugins
|
||||
* we remove them for compatibility reasons.
|
||||
* See : https://github.com/presscustomizr/hueman/issues/454
|
||||
*/
|
||||
/* --------------------------------------------------
|
||||
:: Date Picker
|
||||
---------------------------------------------------*/
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Time Picker
|
||||
---------------------------------------------------*/
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Meta Box Tabs
|
||||
---------------------------------------------------*/
|
||||
.ot-metabox-tabs.ui-tabs .ot-metabox-nav.ui-tabs-nav {
|
||||
float: right;
|
||||
margin: 0 0 0 -1px;
|
||||
}
|
||||
.ot-metabox-tabs.ui-tabs .ot-metabox-nav.ui-tabs-nav li {
|
||||
border-width: 1px 1px 1px 0px;
|
||||
-webkit-border-radius: 0 0 2px 2px;
|
||||
-moz-border-radius: 0 0 2px 2px;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
.ot-metabox-tabs.ui-tabs .ot-metabox-nav.ui-tabs-nav li a {
|
||||
padding: 5px 12px 5px 5px;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------
|
||||
:: Theme Option & Side Metabox Tabs
|
||||
---------------------------------------------------*/
|
||||
.ot-theme-option-tabs.ui-tabs .ot-theme-option-nav.ui-tabs-nav li.ui-state-default,
|
||||
#side-sortables .ot-metabox-tabs.ui-tabs .ot-metabox-nav.ui-tabs-nav li.ui-state-default {
|
||||
float: right;
|
||||
margin: 0 3px 0 0 !important;
|
||||
}
|
||||
|
After Width: | Height: | Size: 289 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 48 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,119 @@
|
||||
/*!
|
||||
* postformats.js v1.0.1
|
||||
*/
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
/* POSTFORMATS CLASS DEFINITION
|
||||
* ====================== */
|
||||
var formats = "input.post-format"
|
||||
, metaboxes = [
|
||||
'#ot-post-format-aside'
|
||||
, '#ot-post-format-audio'
|
||||
, '#ot-post-format-chat'
|
||||
, '#ot-post-format-gallery'
|
||||
, '#ot-post-format-image'
|
||||
, '#ot-post-format-link'
|
||||
, '#ot-post-format-quote'
|
||||
, '#ot-post-format-status'
|
||||
, '#ot-post-format-video'
|
||||
]
|
||||
, ids = metaboxes.join(',')
|
||||
, insertAfter = '#titlediv'
|
||||
, imageBox = '#postimagediv'
|
||||
, placeholder = 'postimagediv-placeholder'
|
||||
, Postformats = function (element, options) {
|
||||
this.$element = $(element)
|
||||
.on('click.postformats.data-api', $.proxy(this.toggle, this))
|
||||
this.$id = this.$element.attr('id')
|
||||
this.init()
|
||||
}
|
||||
|
||||
Postformats.prototype = {
|
||||
|
||||
constructor: Postformats
|
||||
|
||||
, init: function () {
|
||||
|
||||
// Moves the metaboxes into place
|
||||
$( '#ot-' + this.$id ).insertAfter( $( insertAfter ) ).hide()
|
||||
|
||||
// Show the checked metabox
|
||||
if ( this.$element.is(':checked') ) {
|
||||
|
||||
this.show()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
, toggle: function () {
|
||||
|
||||
// Hides all the post format metaboxes
|
||||
$(ids).each(function() {
|
||||
|
||||
$(this).hide()
|
||||
|
||||
})
|
||||
|
||||
// Shows the clicked post format metabox
|
||||
this.show()
|
||||
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
|
||||
// Featured image is never really hidden so it requires different code
|
||||
if ( this.$id == 'post-format-image' ) {
|
||||
|
||||
if ( $( '#' + placeholder ).length == 0 )
|
||||
$( imageBox ).after( '<div id="' + placeholder + '"></div>' ).insertAfter( insertAfter ).css({'marginTop':'20px','marginBottom':'0px'}).find('h3 span').text(option_tree.with)
|
||||
|
||||
// Revert image
|
||||
} else {
|
||||
|
||||
$( '#' + placeholder ).replaceWith( $( imageBox ).css({'marginTop':'0px','marginBottom':'20px'}) )
|
||||
$( imageBox ).find('h3 span').text(option_tree.replace)
|
||||
|
||||
}
|
||||
|
||||
// Show the metabox
|
||||
$( '#ot-' + this.$id ).css({'marginTop':'20px','marginBottom':'0px'}).show()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* POSTFORMATS PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
var old = $.fn.postformats
|
||||
|
||||
$.fn.postformats = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('postformats')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('postformats', (data = new Postformats(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.postformats.Constructor = Postformats
|
||||
|
||||
/* POSTFORMATS NO CONFLICT
|
||||
* ================= */
|
||||
$.fn.postformats.noConflict = function () {
|
||||
$.fn.postformats = old
|
||||
return this
|
||||
}
|
||||
|
||||
/* POSTFORMATS DATA-API
|
||||
* ============== */
|
||||
$(document).on('ready.postformats.data-api', function () {
|
||||
$(formats).each(function () {
|
||||
$(this).postformats()
|
||||
})
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"name": "valendesigns/option-tree",
|
||||
"description": "Theme Options UI Builder for WordPress.",
|
||||
"version": "2.7.3",
|
||||
"type": "wordpress-plugin",
|
||||
"homepage": "https://github.com/valendesigns/option-tree",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Derek Herman",
|
||||
"email": "derek@valendesigns.com",
|
||||
"homepage": "http://valendesigns.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"prefer-stable" : true,
|
||||
"require": {
|
||||
"php": ">=5.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"brainmaestro/composer-git-hooks": "^2.6.0",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
|
||||
"phpcompatibility/phpcompatibility-wp": "*",
|
||||
"php-coveralls/php-coveralls": "^2.1",
|
||||
"slowprog/composer-copy-file": "0.2.1",
|
||||
"wp-coding-standards/wpcs": "*",
|
||||
"xwp/wp-dev-lib": "^1.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"phpcs": [
|
||||
"./vendor/bin/phpcs ${1:.} --standard=.phpcs.ruleset.xml"
|
||||
],
|
||||
"phpcbf": [
|
||||
"./vendor/bin/phpcbf ${1:.} --standard=.phpcs.ruleset.xml"
|
||||
],
|
||||
"phpunit": [
|
||||
"./bin/phpunit.sh xdebug_off"
|
||||
],
|
||||
"phpunit-coverage": [
|
||||
"./bin/phpunit.sh xdebug_on"
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"./bin/install-tests.sh",
|
||||
"./vendor/bin/cghooks add --no-lock",
|
||||
"SlowProg\\CopyFile\\ScriptHandler::copy"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"./bin/install-tests.sh",
|
||||
"./vendor/bin/cghooks update",
|
||||
"SlowProg\\CopyFile\\ScriptHandler::copy"
|
||||
],
|
||||
"readme": [
|
||||
"./vendor/xwp/wp-dev-lib/scripts/generate-markdown-readme"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"copy-file": {
|
||||
"tests/autoload.php": "tests/wp-tests/phpunit/wp-tests-config.php"
|
||||
},
|
||||
"hooks": {
|
||||
"pre-commit": "./vendor/xwp/wp-dev-lib/scripts/pre-commit"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,305 @@
|
||||
<?php
|
||||
/**
|
||||
* OptionTree Meta Box.
|
||||
*
|
||||
* @package OptionTree
|
||||
*/
|
||||
|
||||
if ( ! defined( 'OT_VERSION' ) ) {
|
||||
exit( 'No direct script access allowed' );
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'OT_Meta_Box' ) ) {
|
||||
|
||||
/**
|
||||
* OptionTree Meta Box class.
|
||||
*
|
||||
* This class loads all the methods and helpers specific to build a meta box.
|
||||
*/
|
||||
class OT_Meta_Box {
|
||||
|
||||
/**
|
||||
* Stores the meta box config array.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $meta_box;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* This method adds other methods of the class to specific hooks within WordPress.
|
||||
*
|
||||
* @uses add_action()
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
*
|
||||
* @param array $meta_box Meta box config array.
|
||||
*/
|
||||
public function __construct( $meta_box ) {
|
||||
if ( ! is_admin() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $ot_meta_boxes;
|
||||
|
||||
if ( ! isset( $ot_meta_boxes ) ) {
|
||||
$ot_meta_boxes = array();
|
||||
}
|
||||
|
||||
$ot_meta_boxes[] = $meta_box;
|
||||
|
||||
$this->meta_box = $meta_box;
|
||||
|
||||
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
|
||||
|
||||
add_action( 'save_post', array( $this, 'save_meta_box' ), 1, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds meta box to any post type
|
||||
*
|
||||
* @uses add_meta_box()
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
*/
|
||||
public function add_meta_boxes() {
|
||||
global $wp_version;
|
||||
|
||||
$is_wp_5 = version_compare( $wp_version, '5.0', '>=' );
|
||||
|
||||
foreach ( (array) $this->meta_box['pages'] as $page ) {
|
||||
add_meta_box( $this->meta_box['id'], $this->meta_box['title'], array( $this, 'build_meta_box' ), $page, $this->meta_box['context'], $this->meta_box['priority'], $this->meta_box['fields'] );
|
||||
|
||||
if ( $is_wp_5 ) {
|
||||
add_filter(
|
||||
'postbox_classes_' . $page . '_' . $this->meta_box['id'],
|
||||
function( $classes ) {
|
||||
array_push( $classes, 'ot-meta-box' );
|
||||
return $classes;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta box view.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
*
|
||||
* @param object $post The WP_Post object.
|
||||
* @param array $fields The meta box fields.
|
||||
*/
|
||||
public function build_meta_box( $post, $fields ) {
|
||||
unset( $fields ); // @todo Check if the loop can use this param.
|
||||
|
||||
echo '<div class="ot-metabox-wrapper">';
|
||||
|
||||
// Use nonce for verification.
|
||||
echo '<input type="hidden" name="' . esc_attr( $this->meta_box['id'] ) . '_nonce" value="' . esc_attr( wp_create_nonce( $this->meta_box['id'] ) ) . '" />';
|
||||
|
||||
// Meta box description.
|
||||
echo isset( $this->meta_box['desc'] ) && ! empty( $this->meta_box['desc'] ) ? '<div class="description" style="padding-top:10px;">' . htmlspecialchars_decode( $this->meta_box['desc'] ) . '</div>' : ''; // phpcs:ignore
|
||||
|
||||
// Loop through meta box fields.
|
||||
foreach ( $this->meta_box['fields'] as $field ) {
|
||||
|
||||
// Get current post meta data.
|
||||
$field_value = get_post_meta( $post->ID, $field['id'], true );
|
||||
|
||||
// Set standard value.
|
||||
if ( isset( $field['std'] ) ) {
|
||||
$field_value = ot_filter_std_value( $field_value, $field['std'] );
|
||||
}
|
||||
|
||||
// Build the arguments array.
|
||||
$_args = array(
|
||||
'type' => $field['type'],
|
||||
'field_id' => $field['id'],
|
||||
'field_name' => $field['id'],
|
||||
'field_value' => $field_value,
|
||||
'field_desc' => isset( $field['desc'] ) ? $field['desc'] : '',
|
||||
'field_std' => isset( $field['std'] ) ? $field['std'] : '',
|
||||
'field_rows' => isset( $field['rows'] ) && ! empty( $field['rows'] ) ? $field['rows'] : 10,
|
||||
'field_post_type' => isset( $field['post_type'] ) && ! empty( $field['post_type'] ) ? $field['post_type'] : 'post',
|
||||
'field_taxonomy' => isset( $field['taxonomy'] ) && ! empty( $field['taxonomy'] ) ? $field['taxonomy'] : 'category',
|
||||
'field_min_max_step' => isset( $field['min_max_step'] ) && ! empty( $field['min_max_step'] ) ? $field['min_max_step'] : '0,100,1',
|
||||
'field_class' => isset( $field['class'] ) ? $field['class'] : '',
|
||||
'field_condition' => isset( $field['condition'] ) ? $field['condition'] : '',
|
||||
'field_operator' => isset( $field['operator'] ) ? $field['operator'] : 'and',
|
||||
'field_choices' => isset( $field['choices'] ) ? $field['choices'] : array(),
|
||||
'field_settings' => isset( $field['settings'] ) && ! empty( $field['settings'] ) ? $field['settings'] : array(),
|
||||
'post_id' => $post->ID,
|
||||
'meta' => true,
|
||||
);
|
||||
|
||||
$conditions = '';
|
||||
|
||||
// Setup the conditions.
|
||||
if ( isset( $field['condition'] ) && ! empty( $field['condition'] ) ) {
|
||||
$conditions = ' data-condition="' . esc_attr( $field['condition'] ) . '"';
|
||||
$conditions .= isset( $field['operator'] ) && in_array( $field['operator'], array( 'and', 'AND', 'or', 'OR' ), true ) ? ' data-operator="' . esc_attr( $field['operator'] ) . '"' : '';
|
||||
}
|
||||
|
||||
// Only allow simple textarea due to DOM issues with wp_editor().
|
||||
if ( false === apply_filters( 'ot_override_forced_textarea_simple', false, $field['id'] ) && 'textarea' === $_args['type'] ) {
|
||||
$_args['type'] = 'textarea-simple';
|
||||
}
|
||||
|
||||
// Build the setting CSS class.
|
||||
if ( ! empty( $_args['field_class'] ) ) {
|
||||
|
||||
$classes = explode( ' ', $_args['field_class'] );
|
||||
|
||||
foreach ( $classes as $key => $value ) {
|
||||
|
||||
$classes[ $key ] = $value . '-wrap';
|
||||
|
||||
}
|
||||
|
||||
$class = 'format-settings ' . implode( ' ', $classes );
|
||||
} else {
|
||||
|
||||
$class = 'format-settings';
|
||||
}
|
||||
|
||||
// Option label.
|
||||
echo '<div id="setting_' . esc_attr( $field['id'] ) . '" class="' . esc_attr( $class ) . '"' . $conditions . '>'; // phpcs:ignore
|
||||
|
||||
echo '<div class="format-setting-wrap">';
|
||||
|
||||
// Don't show title with textblocks.
|
||||
if ( 'textblock' !== $_args['type'] && ! empty( $field['label'] ) ) {
|
||||
echo '<div class="format-setting-label">';
|
||||
// @hu_custom: allow html in the label field
|
||||
echo '<label for="' . esc_attr( $field['id'] ) . '" class="label">' . $field['label'] . '</label>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
// Get the option HTML.
|
||||
echo ot_display_by_type( $_args ); // phpcs:ignore
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
}
|
||||
|
||||
echo '<div class="clear"></div>';
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the meta box values
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
*
|
||||
* @param int $post_id The post ID.
|
||||
* @param object $post_object The WP_Post object.
|
||||
* @return int|void
|
||||
*/
|
||||
public function save_meta_box( $post_id, $post_object ) {
|
||||
global $pagenow;
|
||||
|
||||
// Verify nonce.
|
||||
if ( !isset( $_POST[ $this->meta_box['id'] . '_nonce' ] ) || !wp_verify_nonce( $_POST[ $this->meta_box['id'] . '_nonce' ], $this->meta_box['id'] ) ) { // phpcs:ignore
|
||||
return $post_id;
|
||||
}
|
||||
|
||||
// Store the post global for use later.
|
||||
$post_global = $_POST;
|
||||
|
||||
// Don't save if $_POST is empty.
|
||||
if ( empty( $post_global ) || ( isset( $post_global['vc_inline'] ) && true === $post_global['vc_inline'] ) ) {
|
||||
return $post_id;
|
||||
}
|
||||
|
||||
// Don't save during quick edit.
|
||||
if ( 'admin-ajax.php' === $pagenow ) {
|
||||
return $post_id;
|
||||
}
|
||||
|
||||
// Don't save during autosave.
|
||||
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
||||
return $post_id;
|
||||
}
|
||||
|
||||
// Don't save if viewing a revision.
|
||||
if ( 'revision' === $post_object->post_type || 'revision.php' === $pagenow ) {
|
||||
return $post_id;
|
||||
}
|
||||
|
||||
// Check permissions.
|
||||
if ( isset( $post_global['post_type'] ) && 'page' === $post_global['post_type'] ) {
|
||||
if ( ! current_user_can( 'edit_page', $post_id ) ) {
|
||||
return $post_id;
|
||||
}
|
||||
} else {
|
||||
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
||||
return $post_id;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $this->meta_box['fields'] as $field ) {
|
||||
|
||||
$old = get_post_meta( $post_id, $field['id'], true );
|
||||
$new = '';
|
||||
|
||||
// There is data to validate.
|
||||
if ( isset( $post_global[ $field['id'] ] ) ) {
|
||||
// Run through validation.
|
||||
$new = ot_validate_setting( $post_global[ $field['id'] ], $field['type'], $field['id'] );
|
||||
|
||||
// Insert CSS.
|
||||
if ( 'css' === $field['type'] ) {
|
||||
|
||||
if ( '' !== $new ) {
|
||||
|
||||
// insert CSS into dynamic.css.
|
||||
ot_insert_css_with_markers( $field['id'], $new, true );
|
||||
} else {
|
||||
|
||||
// Remove old CSS from dynamic.css.
|
||||
ot_remove_old_css( $field['id'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $new ) && $new !== $old ) {
|
||||
update_post_meta( $post_id, $field['id'], $new );
|
||||
} elseif ( '' === $new && $old ) {
|
||||
delete_post_meta( $post_id, $field['id'], $old );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'ot_register_meta_box' ) ) {
|
||||
|
||||
/**
|
||||
* This method instantiates the meta box class & builds the UI.
|
||||
*
|
||||
* @uses OT_Meta_Box()
|
||||
*
|
||||
* @param array $args Meta box arguments.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function ot_register_meta_box( $args ) {
|
||||
if ( ! $args ) {
|
||||
return;
|
||||
}
|
||||
|
||||
new OT_Meta_Box( $args );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
<?php
|
||||
/**
|
||||
* OptionTree Compatibility Functions.
|
||||
*
|
||||
* @package OptionTree
|
||||
*/
|
||||
|
||||
if ( ! defined( 'OT_VERSION' ) ) {
|
||||
exit( 'No direct script access allowed' );
|
||||
}
|
||||
|
||||
// Run the actions & filters.
|
||||
add_filter( 'ot_option_types_array', 'compat_ot_option_types_array', 10, 1 );
|
||||
add_filter( 'ot_recognized_font_styles', 'compat_ot_recognized_font_styles', 10, 2 );
|
||||
add_filter( 'ot_recognized_font_weights', 'compat_ot_recognized_font_weights', 10, 2 );
|
||||
add_filter( 'ot_recognized_font_variants', 'compat_ot_recognized_font_variants', 10, 2 );
|
||||
add_filter( 'ot_recognized_font_families', 'compat_ot_recognized_font_families', 10, 2 );
|
||||
add_filter( 'ot_recognized_background_repeat', 'compat_ot_recognized_background_repeat', 10, 2 );
|
||||
add_filter( 'ot_recognized_background_position', 'compat_ot_recognized_background_position', 10, 2 );
|
||||
add_filter( 'ot_measurement_unit_types', 'compat_ot_measurement_unit_types', 10, 2 );
|
||||
|
||||
|
||||
if ( ! function_exists( 'compat_ot_option_types_array' ) ) {
|
||||
|
||||
/**
|
||||
* Filters the option types array.
|
||||
*
|
||||
* Allows the old 'option_tree_option_types' filter to
|
||||
* change the new 'ot_option_types_array' return value.
|
||||
*
|
||||
* @param array $array The option types in key:value format.
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function compat_ot_option_types_array( $array ) {
|
||||
|
||||
return apply_filters( 'option_tree_option_types', $array );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'compat_ot_recognized_font_styles' ) ) {
|
||||
|
||||
/**
|
||||
* Filters the recognized font styles array.
|
||||
*
|
||||
* Allows the old 'recognized_font_styles' filter to
|
||||
* change the new 'ot_recognized_font_styles' return value.
|
||||
*
|
||||
* @param array $array The option types in key:value format.
|
||||
* @param string $id The field ID.
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function compat_ot_recognized_font_styles( $array, $id ) {
|
||||
|
||||
return apply_filters( 'recognized_font_styles', $array, $id );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'compat_ot_recognized_font_weights' ) ) {
|
||||
|
||||
/**
|
||||
* Filters the recognized font weights array.
|
||||
*
|
||||
* Allows the old 'recognized_font_weights' filter to
|
||||
* change the new 'ot_recognized_font_weights' return value.
|
||||
*
|
||||
* @param array $array The option types in key:value format.
|
||||
* @param string $id The field ID.
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function compat_ot_recognized_font_weights( $array, $id ) {
|
||||
|
||||
return apply_filters( 'recognized_font_weights', $array, $id );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'compat_ot_recognized_font_variants' ) ) {
|
||||
|
||||
/**
|
||||
* Filters the recognized font variants array.
|
||||
*
|
||||
* Allows the old 'recognized_font_variants' filter to
|
||||
* change the new 'ot_recognized_font_variants' return value.
|
||||
*
|
||||
* @param array $array The option types in key:value format.
|
||||
* @param string $id The field ID.
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function compat_ot_recognized_font_variants( $array, $id ) {
|
||||
|
||||
return apply_filters( 'recognized_font_variants', $array, $id );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'compat_ot_recognized_font_families' ) ) {
|
||||
|
||||
/**
|
||||
* Filters the recognized font families array.
|
||||
*
|
||||
* Allows the old 'recognized_font_families' filter to
|
||||
* change the new 'ot_recognized_font_families' return value.
|
||||
*
|
||||
* @param array $array The option types in key:value format.
|
||||
* @param string $id The field ID.
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function compat_ot_recognized_font_families( $array, $id ) {
|
||||
|
||||
return apply_filters( 'recognized_font_families', $array, $id );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'compat_ot_recognized_background_repeat' ) ) {
|
||||
|
||||
/**
|
||||
* Filters the recognized background repeat array.
|
||||
*
|
||||
* Allows the old 'recognized_background_repeat' filter to
|
||||
* change the new 'ot_recognized_background_repeat' return value.
|
||||
*
|
||||
* @param array $array The option types in key:value format.
|
||||
* @param string $id The field ID.
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function compat_ot_recognized_background_repeat( $array, $id ) {
|
||||
|
||||
return apply_filters( 'recognized_background_repeat', $array, $id );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'compat_ot_recognized_background_position' ) ) {
|
||||
|
||||
/**
|
||||
* Filters the recognized background position array.
|
||||
*
|
||||
* Allows the old 'recognized_background_position' filter to
|
||||
* change the new 'ot_recognized_background_position' return value.
|
||||
*
|
||||
* @param array $array The option types in key:value format.
|
||||
* @param string $id The field ID.
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function compat_ot_recognized_background_position( $array, $id ) {
|
||||
|
||||
return apply_filters( 'recognized_background_position', $array, $id );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'compat_ot_measurement_unit_types' ) ) {
|
||||
|
||||
/**
|
||||
* Filters the measurement unit types array.
|
||||
*
|
||||
* Allows the old 'measurement_unit_types' filter to
|
||||
* change the new 'ot_measurement_unit_types' return value.
|
||||
*
|
||||
* @param array $array The option types in key:value format.
|
||||
* @param string $id The field ID.
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function compat_ot_measurement_unit_types( $array, $id ) {
|
||||
|
||||
return apply_filters( 'measurement_unit_types', $array, $id );
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
/**
|
||||
* OptionTree Deprecated Functions.
|
||||
*
|
||||
* @package OptionTree
|
||||
*/
|
||||
|
||||
if ( ! defined( 'OT_VERSION' ) ) {
|
||||
exit( 'No direct script access allowed' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'get_option_tree' ) ) {
|
||||
|
||||
/**
|
||||
* Displays or returns a value from the 'option_tree' array.
|
||||
*
|
||||
* @param string $item_id The item ID.
|
||||
* @param array $options Options array.
|
||||
* @param bool $echo Whether to echo or return value.
|
||||
* @param bool $is_array Whether the value option is an array or string.
|
||||
* @param int $offset The array key.
|
||||
* @return mixed Array or comma separated lists of values.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0.0
|
||||
* @updated 2.0
|
||||
* @deprecated 2.0
|
||||
*/
|
||||
function get_option_tree( $item_id = '', $options = array(), $echo = false, $is_array = false, $offset = -1 ) {
|
||||
|
||||
// Load saved options.
|
||||
if ( ! $options ) {
|
||||
$options = get_option( ot_options_id() );
|
||||
}
|
||||
|
||||
// No value return.
|
||||
if ( ! isset( $options[ $item_id ] ) || empty( $options[ $item_id ] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set content value & strip slashes.
|
||||
$content = option_tree_stripslashes( $options[ $item_id ] );
|
||||
|
||||
if ( true === $is_array ) {
|
||||
if ( ! is_array( $content ) ) {
|
||||
$content = explode( ',', $content );
|
||||
}
|
||||
|
||||
if ( is_numeric( $offset ) && 0 <= $offset ) {
|
||||
$content = $content[ $offset ];
|
||||
} elseif ( ! is_numeric( $offset ) && isset( $content[ $offset ] ) ) {
|
||||
$content = $content[ $offset ];
|
||||
}
|
||||
} else {
|
||||
if ( is_array( $content ) ) {
|
||||
$content = implode( ',', $content );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $echo ) {
|
||||
echo $content; // phpcs:ignore
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'option_tree_stripslashes' ) ) {
|
||||
|
||||
/**
|
||||
* Custom stripslashes from single value or array.
|
||||
*
|
||||
* @param mixed $input Input string or array.
|
||||
* @return mixed
|
||||
*
|
||||
* @access public
|
||||
* @since 1.1.3
|
||||
* @deprecated 2.0
|
||||
*/
|
||||
function option_tree_stripslashes( $input ) {
|
||||
if ( is_array( $input ) ) {
|
||||
foreach ( $input as &$val ) {
|
||||
if ( is_array( $val ) ) {
|
||||
$val = option_tree_stripslashes( $val );
|
||||
} else {
|
||||
$val = stripslashes( $val );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$input = stripslashes( $input );
|
||||
}
|
||||
return $input;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
<?php
|
||||
/**
|
||||
* OptionTree Function.
|
||||
*
|
||||
* @package OptionTree
|
||||
*/
|
||||
|
||||
if ( ! defined( 'OT_VERSION' ) ) {
|
||||
exit( 'No direct script access allowed' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'ot_options_id' ) ) {
|
||||
|
||||
/**
|
||||
* Theme Options ID
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @access public
|
||||
* @since 2.3.0
|
||||
*/
|
||||
function ot_options_id() {
|
||||
|
||||
return apply_filters( 'ot_options_id', 'option_tree' );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'ot_settings_id' ) ) {
|
||||
|
||||
/**
|
||||
* Theme Settings ID
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @access public
|
||||
* @since 2.3.0
|
||||
*/
|
||||
function ot_settings_id() {
|
||||
|
||||
return apply_filters( 'ot_settings_id', 'option_tree_settings' );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'ot_layouts_id' ) ) {
|
||||
|
||||
/**
|
||||
* Theme Layouts ID
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @access public
|
||||
* @since 2.3.0
|
||||
*/
|
||||
function ot_layouts_id() {
|
||||
|
||||
return apply_filters( 'ot_layouts_id', 'option_tree_layouts' );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'ot_get_option' ) ) {
|
||||
|
||||
/**
|
||||
* Get Option.
|
||||
*
|
||||
* Helper function to return the option value.
|
||||
* If no value has been saved, it returns $default.
|
||||
*
|
||||
* @param string $option_id The option ID.
|
||||
* @param string $default The default option value.
|
||||
* @return mixed
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function ot_get_option( $option_id, $default = '' ) {
|
||||
|
||||
// @hu_custom Temporary hack.
|
||||
if ( ! apply_filters( 'use_option_tree' , true ) && class_exists( 'HU_utils' ) ) {
|
||||
return HU_utils::$inst->hu_opt( $option_id );
|
||||
}
|
||||
|
||||
// Get the saved options.
|
||||
$options = get_option( ot_options_id() );
|
||||
|
||||
// Look for the saved value.
|
||||
if ( isset( $options[ $option_id ] ) && '' !== $options[ $option_id ] ) {
|
||||
|
||||
return ot_wpml_filter( $options, $option_id );
|
||||
|
||||
}
|
||||
|
||||
return $default;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'ot_echo_option' ) ) {
|
||||
|
||||
/**
|
||||
* Echo Option.
|
||||
*
|
||||
* Helper function to echo the option value.
|
||||
* If no value has been saved, it echos $default.
|
||||
*
|
||||
* @param string $option_id The option ID.
|
||||
* @param string $default The default option value.
|
||||
* @return mixed
|
||||
*
|
||||
* @access public
|
||||
* @since 2.2.0
|
||||
*/
|
||||
function ot_echo_option( $option_id, $default = '' ) {
|
||||
|
||||
echo ot_get_option( $option_id, $default ); // phpcs:ignore
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'ot_wpml_filter' ) ) {
|
||||
|
||||
/**
|
||||
* Filter the return values through WPML
|
||||
*
|
||||
* @param array $options The current options.
|
||||
* @param string $option_id The option ID.
|
||||
* @return mixed
|
||||
*
|
||||
* @access public
|
||||
* @since 2.1
|
||||
*/
|
||||
function ot_wpml_filter( $options, $option_id ) {
|
||||
|
||||
// Return translated strings using WMPL.
|
||||
if ( function_exists( 'icl_t' ) ) {
|
||||
|
||||
$settings = get_option( ot_settings_id() );
|
||||
|
||||
if ( isset( $settings['settings'] ) ) {
|
||||
|
||||
foreach ( $settings['settings'] as $setting ) {
|
||||
|
||||
// List Item & Slider.
|
||||
if ( $option_id === $setting['id'] && in_array( $setting['type'], array( 'list-item', 'slider' ), true ) ) {
|
||||
|
||||
foreach ( $options[ $option_id ] as $key => $value ) {
|
||||
|
||||
foreach ( $value as $ckey => $cvalue ) {
|
||||
|
||||
$id = $option_id . '_' . $ckey . '_' . $key;
|
||||
$_string = icl_t( 'Theme Options', $id, $cvalue );
|
||||
|
||||
if ( ! empty( $_string ) ) {
|
||||
|
||||
$options[ $option_id ][ $key ][ $ckey ] = $_string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// List Item & Slider.
|
||||
} elseif ( $option_id === $setting['id'] && 'social-links' === $setting['type'] ) {
|
||||
|
||||
foreach ( $options[ $option_id ] as $key => $value ) {
|
||||
|
||||
foreach ( $value as $ckey => $cvalue ) {
|
||||
|
||||
$id = $option_id . '_' . $ckey . '_' . $key;
|
||||
$_string = icl_t( 'Theme Options', $id, $cvalue );
|
||||
|
||||
if ( ! empty( $_string ) ) {
|
||||
|
||||
$options[ $option_id ][ $key ][ $ckey ] = $_string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// All other acceptable option types.
|
||||
} elseif ( $option_id === $setting['id'] && in_array( $setting['type'], apply_filters( 'ot_wpml_option_types', array( 'text', 'textarea', 'textarea-simple' ) ), true ) ) {
|
||||
|
||||
$_string = icl_t( 'Theme Options', $option_id, $options[ $option_id ] );
|
||||
|
||||
if ( ! empty( $_string ) ) {
|
||||
|
||||
$options[ $option_id ] = $_string;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $options[ $option_id ];
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'ot_load_dynamic_css' ) ) {
|
||||
|
||||
/**
|
||||
* Enqueue the dynamic CSS.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
function ot_load_dynamic_css() {
|
||||
|
||||
// Don't load in the admin.
|
||||
if ( is_admin() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter whether or not to enqueue a `dynamic.css` file at the theme level.
|
||||
*
|
||||
* By filtering this to `false` OptionTree will not attempt to enqueue any CSS files.
|
||||
*
|
||||
* Example: add_filter( 'ot_load_dynamic_css', '__return_false' );
|
||||
*
|
||||
* @since 2.5.5
|
||||
*
|
||||
* @param bool $load_dynamic_css Default is `true`.
|
||||
* @return bool
|
||||
*/
|
||||
if ( false === (bool) apply_filters( 'ot_load_dynamic_css', true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Grab a copy of the paths.
|
||||
$ot_css_file_paths = get_option( 'ot_css_file_paths', array() );
|
||||
if ( is_multisite() ) {
|
||||
$ot_css_file_paths = get_blog_option( get_current_blog_id(), 'ot_css_file_paths', $ot_css_file_paths );
|
||||
}
|
||||
|
||||
if ( ! empty( $ot_css_file_paths ) ) {
|
||||
|
||||
$last_css = '';
|
||||
|
||||
// Loop through paths.
|
||||
foreach ( $ot_css_file_paths as $key => $path ) {
|
||||
|
||||
if ( '' !== $path && file_exists( $path ) ) {
|
||||
|
||||
$parts = explode( '/wp-content', $path );
|
||||
|
||||
if ( isset( $parts[1] ) ) {
|
||||
|
||||
$sub_parts = explode( '/', $parts[1] );
|
||||
|
||||
if ( isset( $sub_parts[1] ) && isset( $sub_parts[2] ) ) {
|
||||
if ( 'themes' !== $sub_parts[1] && get_stylesheet() !== $sub_parts[2] ) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$css = set_url_scheme( WP_CONTENT_URL ) . $parts[1];
|
||||
|
||||
if ( $last_css !== $css ) {
|
||||
|
||||
// Enqueue filtered file.
|
||||
wp_enqueue_style( 'ot-dynamic-' . $key, $css, false, OT_VERSION );
|
||||
|
||||
$last_css = $css;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'ot_load_google_fonts_css' ) ) {
|
||||
|
||||
/**
|
||||
* Enqueue the Google Fonts CSS.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.5.0
|
||||
*/
|
||||
function ot_load_google_fonts_css() {
|
||||
|
||||
/* don't load in the admin */
|
||||
if ( is_admin() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$ot_google_fonts = get_theme_mod( 'ot_google_fonts', array() );
|
||||
$ot_set_google_fonts = get_theme_mod( 'ot_set_google_fonts', array() );
|
||||
$families = array();
|
||||
$subsets = array();
|
||||
$append = '';
|
||||
|
||||
if ( ! empty( $ot_set_google_fonts ) ) {
|
||||
|
||||
foreach ( $ot_set_google_fonts as $id => $fonts ) {
|
||||
|
||||
foreach ( $fonts as $font ) {
|
||||
|
||||
// Can't find the font, bail!
|
||||
if ( ! isset( $ot_google_fonts[ $font['family'] ]['family'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Set variants & subsets.
|
||||
if ( ! empty( $font['variants'] ) && is_array( $font['variants'] ) ) {
|
||||
|
||||
// Variants string.
|
||||
$variants = ':' . implode( ',', $font['variants'] );
|
||||
|
||||
// Add subsets to array.
|
||||
if ( ! empty( $font['subsets'] ) && is_array( $font['subsets'] ) ) {
|
||||
foreach ( $font['subsets'] as $subset ) {
|
||||
$subsets[] = $subset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add family & variants to array.
|
||||
if ( isset( $variants ) ) {
|
||||
$families[] = str_replace( ' ', '+', $ot_google_fonts[ $font['family'] ]['family'] ) . $variants;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $families ) ) {
|
||||
|
||||
$families = array_unique( $families );
|
||||
|
||||
// Append all subsets to the path, unless the only subset is latin.
|
||||
if ( ! empty( $subsets ) ) {
|
||||
$subsets = implode( ',', array_unique( $subsets ) );
|
||||
if ( 'latin' !== $subsets ) {
|
||||
$append = '&subset=' . $subsets;
|
||||
}
|
||||
}
|
||||
|
||||
wp_enqueue_style( 'ot-google-fonts', esc_url( '//fonts.googleapis.com/css?family=' . implode( '%7C', $families ) ) . $append, false, null ); // phpcs:ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'ot_register_theme_options_admin_bar_menu' ) ) {
|
||||
|
||||
/**
|
||||
* Registers the Theme Option page link for the admin bar.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.1
|
||||
*
|
||||
* @param object $wp_admin_bar The WP_Admin_Bar object.
|
||||
*/
|
||||
function ot_register_theme_options_admin_bar_menu( $wp_admin_bar ) {
|
||||
|
||||
if ( ! current_user_can( apply_filters( 'ot_theme_options_capability', 'edit_theme_options' ) ) || ! is_admin_bar_showing() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wp_admin_bar->add_node(
|
||||
array(
|
||||
'parent' => 'appearance',
|
||||
'id' => apply_filters( 'ot_theme_options_menu_slug', 'ot-theme-options' ),
|
||||
'title' => apply_filters( 'ot_theme_options_page_title', __( 'Theme Options', 'hueman' ) ),
|
||||
'href' => admin_url( apply_filters( 'ot_theme_options_parent_slug', 'themes.php' ) . '?page=' . apply_filters( 'ot_theme_options_menu_slug', 'ot-theme-options' ) ),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,719 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: HuemanOptionTree
|
||||
* Plugin URI: https://github.com/valendesigns/option-tree/
|
||||
* Description: Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
||||
* Version: 2.7.3
|
||||
* Author: Derek Herman
|
||||
* Author URI: http://valendesigns.com
|
||||
* License: GPLv2 or later
|
||||
* Text Domain: option-tree
|
||||
*
|
||||
* @package OptionTree
|
||||
*/
|
||||
|
||||
if ( class_exists( 'OT_Loader' ) && defined( 'OT_PLUGIN_MODE' ) && true === OT_PLUGIN_MODE && defined( 'ABSPATH' ) ) {
|
||||
|
||||
add_filter( 'ot_theme_mode', '__return_false', 999 );
|
||||
|
||||
/**
|
||||
* Forces Plugin Mode when OptionTree is already loaded and displays an admin notice.
|
||||
*/
|
||||
function ot_conflict_notice() {
|
||||
// @hu_addon: do not print any conflict notice
|
||||
// echo '<div class="error"><p>' . esc_html__( 'OptionTree is installed as a plugin and also embedded in your current theme. Please deactivate the plugin to load the theme dependent version of OptionTree, and remove this warning.', 'option-tree' ) . '</p></div>';
|
||||
echo '';
|
||||
}
|
||||
|
||||
add_action( 'admin_notices', 'ot_conflict_notice' );
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'OT_Loader' ) && defined( 'ABSPATH' ) ) {
|
||||
|
||||
/**
|
||||
* OptionTree loader class.
|
||||
*/
|
||||
class OT_Loader {
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* This method loads other methods of the class.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
// Load OptionTree.
|
||||
add_action( 'after_setup_theme', array( $this, 'load_option_tree' ), 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* OptionTree loads on the 'after_setup_theme' action.
|
||||
*
|
||||
* @todo Load immediately.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.1.2
|
||||
*/
|
||||
public function load_option_tree() {
|
||||
|
||||
// Setup the constants.
|
||||
$this->constants();
|
||||
|
||||
// Include the required admin files.
|
||||
$this->admin_includes();
|
||||
|
||||
// Include the required files.
|
||||
$this->includes();
|
||||
|
||||
// Hook into WordPress.
|
||||
$this->hooks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constants.
|
||||
*
|
||||
* Defines the constants for use within OptionTree. Constants
|
||||
* are prefixed with 'OT_' to avoid any naming collisions.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.0
|
||||
*/
|
||||
private function constants() {
|
||||
|
||||
/**
|
||||
* Current Version number.
|
||||
* June 2020 : was 2.7.3, changed to 4.0.0 for https://secure.helpscout.net/conversation/1180630434/221581/
|
||||
*/
|
||||
define( 'OT_VERSION', '4.0.0' );
|
||||
|
||||
/**
|
||||
* For developers: Theme mode.
|
||||
*
|
||||
* Run a filter and set to true to enable OptionTree theme mode.
|
||||
* You must have this files parent directory inside of
|
||||
* your themes root directory. As well, you must include
|
||||
* a reference to this file in your themes functions.php.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
define( 'OT_THEME_MODE', apply_filters( 'ot_theme_mode', false ) );
|
||||
|
||||
/**
|
||||
* For developers: Child Theme mode. TODO document
|
||||
*
|
||||
* Run a filter and set to true to enable OptionTree child theme mode.
|
||||
* You must have this files parent directory inside of
|
||||
* your themes root directory. As well, you must include
|
||||
* a reference to this file in your themes functions.php.
|
||||
*
|
||||
* @since 2.0.15
|
||||
*/
|
||||
define( 'OT_CHILD_THEME_MODE', apply_filters( 'ot_child_theme_mode', false ) );
|
||||
|
||||
/**
|
||||
* For developers: Show Pages.
|
||||
*
|
||||
* Run a filter and set to false if you don't want to load the
|
||||
* settings & documentation pages in the admin area of WordPress.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
define( 'OT_SHOW_PAGES', apply_filters( 'ot_show_pages', true ) );
|
||||
|
||||
/**
|
||||
* For developers: Show Theme Options UI Builder
|
||||
*
|
||||
* Run a filter and set to false if you want to hide the
|
||||
* Theme Options UI page in the admin area of WordPress.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
define( 'OT_SHOW_OPTIONS_UI', apply_filters( 'ot_show_options_ui', true ) );
|
||||
|
||||
/**
|
||||
* For developers: Show Settings Import
|
||||
*
|
||||
* Run a filter and set to false if you want to hide the
|
||||
* Settings Import options on the Import page.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
define( 'OT_SHOW_SETTINGS_IMPORT', apply_filters( 'ot_show_settings_import', true ) );
|
||||
|
||||
/**
|
||||
* For developers: Show Settings Export
|
||||
*
|
||||
* Run a filter and set to false if you want to hide the
|
||||
* Settings Import options on the Import page.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
define( 'OT_SHOW_SETTINGS_EXPORT', apply_filters( 'ot_show_settings_export', true ) );
|
||||
|
||||
/**
|
||||
* For developers: Show New Layout.
|
||||
*
|
||||
* Run a filter and set to false if you don't want to show the
|
||||
* "New Layout" section at the top of the theme options page.
|
||||
*
|
||||
* @since 2.0.10
|
||||
*/
|
||||
define( 'OT_SHOW_NEW_LAYOUT', apply_filters( 'ot_show_new_layout', true ) );
|
||||
|
||||
/**
|
||||
* For developers: Show Documentation
|
||||
*
|
||||
* Run a filter and set to false if you want to hide the Documentation.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
define( 'OT_SHOW_DOCS', apply_filters( 'ot_show_docs', true ) );
|
||||
|
||||
/**
|
||||
* For developers: Custom Theme Option page
|
||||
*
|
||||
* Run a filter and set to false if you want to hide the OptionTree
|
||||
* Theme Option page and build your own.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
define( 'OT_USE_THEME_OPTIONS', apply_filters( 'ot_use_theme_options', true ) );
|
||||
|
||||
/**
|
||||
* For developers: Meta Boxes.
|
||||
*
|
||||
* Run a filter and set to false to keep OptionTree from
|
||||
* loading the meta box resources.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
define( 'OT_META_BOXES', apply_filters( 'ot_meta_boxes', true ) );
|
||||
|
||||
/**
|
||||
* For developers: Allow Unfiltered HTML in all the textareas.
|
||||
*
|
||||
* Run a filter and set to true if you want all the users to be
|
||||
* able to add script, style, and iframe tags in the textareas.
|
||||
* WARNING: This opens a security hole for low level users
|
||||
* to be able to post malicious scripts, you've been warned.
|
||||
*
|
||||
* If a user can already post `unfiltered_html` then the tags
|
||||
* above will be available to them without setting this to `true`.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
define( 'OT_ALLOW_UNFILTERED_HTML', apply_filters( 'ot_allow_unfiltered_html', false ) );
|
||||
|
||||
/**
|
||||
* For developers: Post Formats.
|
||||
*
|
||||
* Run a filter and set to true if you want OptionTree
|
||||
* to load meta boxes for post formats.
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
define( 'OT_POST_FORMATS', apply_filters( 'ot_post_formats', false ) );
|
||||
|
||||
/**
|
||||
* Check if in theme mode.
|
||||
*
|
||||
* If OT_THEME_MODE and OT_CHILD_THEME_MODE is false, set the
|
||||
* directory path & URL like any other plugin. Otherwise, use
|
||||
* the parent or child themes root directory.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
if ( false === OT_THEME_MODE && false === OT_CHILD_THEME_MODE ) {
|
||||
define( 'OT_DIR', plugin_dir_path( __FILE__ ) );
|
||||
define( 'OT_URL', plugin_dir_url( __FILE__ ) );
|
||||
} else {
|
||||
if ( true === OT_CHILD_THEME_MODE ) {
|
||||
$temp_path = explode( get_stylesheet(), str_replace( '\\', '/', dirname( __FILE__ ) ) );
|
||||
$path = ltrim( end( $temp_path ), '/' );
|
||||
define( 'OT_DIR', trailingslashit( trailingslashit( get_stylesheet_directory() ) . $path ) );
|
||||
define( 'OT_URL', trailingslashit( trailingslashit( get_stylesheet_directory_uri() ) . $path ) );
|
||||
} else {
|
||||
$temp_path = explode( get_template(), str_replace( '\\', '/', dirname( __FILE__ ) ) );
|
||||
$path = ltrim( end( $temp_path ), '/' );
|
||||
define( 'OT_DIR', trailingslashit( trailingslashit( get_template_directory() ) . $path ) );
|
||||
define( 'OT_URL', trailingslashit( trailingslashit( get_template_directory_uri() ) . $path ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Template directory URI for the current theme.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
if ( true === OT_CHILD_THEME_MODE ) {
|
||||
define( 'OT_THEME_URL', get_stylesheet_directory_uri() );
|
||||
} else {
|
||||
define( 'OT_THEME_URL', get_template_directory_uri() );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Include admin files.
|
||||
*
|
||||
* These functions are included on admin pages only.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.0
|
||||
*/
|
||||
private function admin_includes() {
|
||||
|
||||
// Exit early if we're not on an admin page.
|
||||
if ( ! is_admin() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Global include files.
|
||||
$files = array(
|
||||
'ot-functions-admin',
|
||||
'ot-functions-option-types',
|
||||
'ot-functions-compat',
|
||||
// @hu_custom: do not includ
|
||||
// 'class-ot-settings',
|
||||
);
|
||||
|
||||
// Include the meta box api.
|
||||
if ( true === OT_META_BOXES ) {
|
||||
$files[] = 'class-ot-meta-box';
|
||||
}
|
||||
|
||||
// Include the post formats api.
|
||||
if ( true === OT_META_BOXES && true === OT_POST_FORMATS ) {
|
||||
// @hu_custom: do not load.
|
||||
//$files[] = 'class-ot-post-formats';
|
||||
}
|
||||
|
||||
// Include the settings & docs pages.
|
||||
if ( true === OT_SHOW_PAGES ) {
|
||||
// @hu_custom: do not load.
|
||||
//$files[] = 'ot-functions-settings-page';
|
||||
//$files[] = 'ot-functions-docs-page';
|
||||
}
|
||||
|
||||
// Include the cleanup api.
|
||||
// @hu_custom: do not load.
|
||||
//$files[] = 'class-ot-cleanup';
|
||||
|
||||
// Require the files.
|
||||
foreach ( $files as $file ) {
|
||||
$this->load_file( OT_DIR . 'includes' . DIRECTORY_SEPARATOR . "{$file}.php" );
|
||||
}
|
||||
|
||||
// @hu_custom: do not do.
|
||||
// Registers the Theme Option page.
|
||||
// add_action( 'init', 'ot_register_theme_options_page' );
|
||||
|
||||
// Registers the Settings page.
|
||||
if ( true === OT_SHOW_PAGES ) {
|
||||
add_action( 'init', 'ot_register_settings_page' );
|
||||
|
||||
// Global CSS.
|
||||
add_action( 'admin_head', array( $this, 'global_admin_css' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Include front-end files.
|
||||
*
|
||||
* These functions are included on every page load
|
||||
* incase other plugins need to access them.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.0
|
||||
*/
|
||||
private function includes() {
|
||||
|
||||
$files = array(
|
||||
'ot-functions',
|
||||
'ot-functions-deprecated',
|
||||
);
|
||||
|
||||
// Require the files.
|
||||
foreach ( $files as $file ) {
|
||||
$this->load_file( OT_DIR . 'includes' . DIRECTORY_SEPARATOR . "{$file}.php" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the WordPress Hooks.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*/
|
||||
private function hooks() {
|
||||
|
||||
// Attempt to migrate the settings.
|
||||
if ( function_exists( 'ot_maybe_migrate_settings' ) ) {
|
||||
add_action( 'init', 'ot_maybe_migrate_settings', 1 );
|
||||
}
|
||||
|
||||
// Attempt to migrate the Options.
|
||||
if ( function_exists( 'ot_maybe_migrate_options' ) ) {
|
||||
add_action( 'init', 'ot_maybe_migrate_options', 1 );
|
||||
}
|
||||
|
||||
// Attempt to migrate the Layouts.
|
||||
if ( function_exists( 'ot_maybe_migrate_layouts' ) ) {
|
||||
add_action( 'init', 'ot_maybe_migrate_layouts', 1 );
|
||||
}
|
||||
|
||||
// Load the Meta Box assets.
|
||||
if ( true === OT_META_BOXES ) {
|
||||
|
||||
// Add scripts for metaboxes to post-new.php & post.php.
|
||||
add_action( 'admin_print_scripts-post-new.php', 'ot_admin_scripts', 11 );
|
||||
add_action( 'admin_print_scripts-post.php', 'ot_admin_scripts', 11 );
|
||||
|
||||
// Add styles for metaboxes to post-new.php & post.php.
|
||||
add_action( 'admin_print_styles-post-new.php', 'ot_admin_styles', 11 );
|
||||
add_action( 'admin_print_styles-post.php', 'ot_admin_styles', 11 );
|
||||
|
||||
}
|
||||
|
||||
// Adds the Theme Option page to the admin bar.
|
||||
add_action( 'admin_bar_menu', 'ot_register_theme_options_admin_bar_menu', 999 );
|
||||
|
||||
// @hu_custom: do not do.
|
||||
// Prepares the after save do_action.
|
||||
// add_action( 'admin_init', 'ot_after_theme_options_save', 1 );
|
||||
|
||||
// @hu_custom: do not do.
|
||||
// default settings.
|
||||
// add_action( 'admin_init', 'ot_default_settings', 2 );
|
||||
|
||||
// @hu_custom: do not do.
|
||||
// Import.
|
||||
// add_action( 'admin_init', 'ot_import', 4 );
|
||||
|
||||
// @hu_custom: do not do.
|
||||
// Export.
|
||||
// add_action( 'admin_init', 'ot_export', 5 );
|
||||
|
||||
// @hu_custom
|
||||
// Managing plugins on jetpack's wordpress.com dashboard fix
|
||||
// https://github.com/presscustomizr/hueman/issues/541
|
||||
// For some reason admin_init is fired but is_admin() returns false
|
||||
// so some required admin files are not loaded:
|
||||
// see $this->admin_includes() : it returns if not is_admin()
|
||||
if ( is_admin() ) {
|
||||
// Save settings.
|
||||
add_action( 'admin_init', 'ot_save_settings', 6 );
|
||||
}
|
||||
// Google Fonts front-end CSS.
|
||||
add_action( 'wp_enqueue_scripts', 'ot_load_google_fonts_css', 1 );
|
||||
|
||||
// Dynamic front-end CSS.
|
||||
add_action( 'wp_enqueue_scripts', 'ot_load_dynamic_css', 999 );
|
||||
|
||||
// Insert theme CSS dynamically.
|
||||
add_action( 'ot_after_theme_options_save', 'ot_save_css' );
|
||||
|
||||
// AJAX call to create a new section.
|
||||
add_action( 'wp_ajax_add_section', array( $this, 'add_section' ) );
|
||||
|
||||
// AJAX call to create a new setting.
|
||||
add_action( 'wp_ajax_add_setting', array( $this, 'add_setting' ) );
|
||||
|
||||
// AJAX call to create a new contextual help.
|
||||
add_action( 'wp_ajax_add_the_contextual_help', array( $this, 'add_the_contextual_help' ) );
|
||||
|
||||
// AJAX call to create a new choice.
|
||||
add_action( 'wp_ajax_add_choice', array( $this, 'add_choice' ) );
|
||||
|
||||
// AJAX call to create a new list item setting.
|
||||
add_action( 'wp_ajax_add_list_item_setting', array( $this, 'add_list_item_setting' ) );
|
||||
|
||||
// AJAX call to create a new layout.
|
||||
add_action( 'wp_ajax_add_layout', array( $this, 'add_layout' ) );
|
||||
|
||||
// AJAX call to create a new list item.
|
||||
add_action( 'wp_ajax_add_list_item', array( $this, 'add_list_item' ) );
|
||||
|
||||
// AJAX call to create a new social link.
|
||||
add_action( 'wp_ajax_add_social_links', array( $this, 'add_social_links' ) );
|
||||
|
||||
// AJAX call to retrieve Google Font data.
|
||||
add_action( 'wp_ajax_ot_google_font', array( $this, 'retrieve_google_font' ) );
|
||||
|
||||
// Adds the temporary hacktastic shortcode.
|
||||
add_filter( 'media_view_settings', array( $this, 'shortcode' ), 10, 2 );
|
||||
|
||||
// AJAX update.
|
||||
add_action( 'wp_ajax_gallery_update', array( $this, 'ajax_gallery_update' ) );
|
||||
|
||||
// Modify the media uploader button.
|
||||
add_filter( 'gettext', array( $this, 'change_image_button' ), 10, 3 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a file.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.0.15
|
||||
*
|
||||
* @param string $file Path to the file being included.
|
||||
*/
|
||||
private function load_file( $file ) {
|
||||
include_once $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds CSS for the menu icon.
|
||||
*/
|
||||
public function global_admin_css() {
|
||||
?>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "option-tree-font";
|
||||
src:url("<?php echo esc_url_raw( OT_URL ); ?>assets/fonts/option-tree-font.eot");
|
||||
src:url("<?php echo esc_url_raw( OT_URL ); ?>assets/fonts/option-tree-font.eot?#iefix") format("embedded-opentype"),
|
||||
url("<?php echo esc_url_raw( OT_URL ); ?>assets/fonts/option-tree-font.woff") format("woff"),
|
||||
url("<?php echo esc_url_raw( OT_URL ); ?>assets/fonts/option-tree-font.ttf") format("truetype"),
|
||||
url("<?php echo esc_url_raw( OT_URL ); ?>assets/fonts/option-tree-font.svg#option-tree-font") format("svg");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
#adminmenu #toplevel_page_ot-settings .menu-icon-generic div.wp-menu-image:before {
|
||||
font: normal 20px/1 "option-tree-font" !important;
|
||||
speak: none;
|
||||
padding: 6px 0;
|
||||
height: 34px;
|
||||
width: 20px;
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-transition: all .1s ease-in-out;
|
||||
-moz-transition: all .1s ease-in-out;
|
||||
transition: all .1s ease-in-out;
|
||||
}
|
||||
#adminmenu #toplevel_page_ot-settings .menu-icon-generic div.wp-menu-image:before {
|
||||
content: "\e785";
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX utility function for adding a new section.
|
||||
*/
|
||||
public function add_section() {
|
||||
check_ajax_referer( 'option_tree', 'nonce' );
|
||||
|
||||
$count = isset( $_REQUEST['count'] ) ? absint( $_REQUEST['count'] ) : 0;
|
||||
// @hu_custom: do not do.
|
||||
/*
|
||||
$output = ot_sections_view( ot_settings_id() . '[sections]', $count );
|
||||
|
||||
echo $output; // phpcs:ignore
|
||||
*/
|
||||
wp_die();
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX utility function for adding a new setting.
|
||||
*/
|
||||
public function add_setting() {
|
||||
check_ajax_referer( 'option_tree', 'nonce' );
|
||||
|
||||
$name = isset( $_REQUEST['name'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['name'] ) ) : '';
|
||||
$count = isset( $_REQUEST['count'] ) ? absint( $_REQUEST['count'] ) : 0;
|
||||
$output = ot_settings_view( $name, $count );
|
||||
|
||||
echo $output; // phpcs:ignore
|
||||
wp_die();
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX utility function for adding a new list item setting.
|
||||
*/
|
||||
public function add_list_item_setting() {
|
||||
check_ajax_referer( 'option_tree', 'nonce' );
|
||||
|
||||
$name = isset( $_REQUEST['name'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['name'] ) ) : '';
|
||||
$count = isset( $_REQUEST['count'] ) ? absint( $_REQUEST['count'] ) : 0;
|
||||
$output = ot_settings_view( $name . '[settings]', $count );
|
||||
|
||||
echo $output; // phpcs:ignore
|
||||
wp_die();
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX utility function for adding new contextual help content.
|
||||
*/
|
||||
public function add_the_contextual_help() {
|
||||
check_ajax_referer( 'option_tree', 'nonce' );
|
||||
|
||||
$name = isset( $_REQUEST['name'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['name'] ) ) : '';
|
||||
$count = isset( $_REQUEST['count'] ) ? absint( $_REQUEST['count'] ) : 0;
|
||||
$output = ot_contextual_help_view( $name, $count );
|
||||
|
||||
echo $output; // phpcs:ignore
|
||||
wp_die();
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX utility function for adding a new choice.
|
||||
*/
|
||||
public function add_choice() {
|
||||
check_ajax_referer( 'option_tree', 'nonce' );
|
||||
|
||||
$name = isset( $_REQUEST['name'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['name'] ) ) : '';
|
||||
$count = isset( $_REQUEST['count'] ) ? absint( $_REQUEST['count'] ) : 0;
|
||||
$output = ot_choices_view( $name, $count );
|
||||
|
||||
echo $output; // phpcs:ignore
|
||||
wp_die();
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX utility function for adding a new layout.
|
||||
*/
|
||||
public function add_layout() {
|
||||
check_ajax_referer( 'option_tree', 'nonce' );
|
||||
|
||||
$count = isset( $_REQUEST['count'] ) ? absint( $_REQUEST['count'] ) : 0;
|
||||
$output = ot_layout_view( $count );
|
||||
|
||||
echo $output; // phpcs:ignore
|
||||
wp_die();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fake the gallery shortcode.
|
||||
*
|
||||
* The JS takes over and creates the actual shortcode with
|
||||
* the real attachment IDs on the fly. Here we just need to
|
||||
* pass in the post ID to get the ball rolling.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.2.0
|
||||
*
|
||||
* @param array $settings The current settings.
|
||||
* @param object $post The post object.
|
||||
* @return array
|
||||
*/
|
||||
public function shortcode( $settings, $post ) {
|
||||
global $pagenow;
|
||||
|
||||
if ( in_array( $pagenow, array( 'upload.php', 'customize.php' ), true ) ) {
|
||||
return $settings;
|
||||
}
|
||||
|
||||
// Set the OptionTree post ID.
|
||||
if ( ! is_object( $post ) ) {
|
||||
$post_id = isset( $_GET['post'] ) ? absint( $_GET['post'] ) : ( isset( $_GET['post_ID'] ) ? absint( $_GET['post_ID'] ) : 0 ); // phpcs:ignore
|
||||
if ( 0 >= $post_id && function_exists( 'ot_get_media_post_ID' ) ) {
|
||||
$post_id = ot_get_media_post_ID();
|
||||
}
|
||||
$settings['post']['id'] = $post_id;
|
||||
}
|
||||
|
||||
// No ID return settings.
|
||||
if ( 0 >= $settings['post']['id'] ) {
|
||||
return $settings;
|
||||
}
|
||||
|
||||
// Set the fake shortcode.
|
||||
$settings['ot_gallery'] = array( 'shortcode' => "[gallery id='{$settings['post']['id']}']" );
|
||||
|
||||
// Return settings.
|
||||
return $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX to generate HTML for a list of gallery images.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function ajax_gallery_update() {
|
||||
check_ajax_referer( 'option_tree', 'nonce' );
|
||||
|
||||
if ( ! empty( $_POST['ids'] ) && is_array( $_POST['ids'] ) ) {
|
||||
|
||||
$html = '';
|
||||
$ids = array_filter( $_POST['ids'], 'absint' ); // phpcs:ignore
|
||||
|
||||
foreach ( $ids as $id ) {
|
||||
|
||||
$thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
|
||||
|
||||
$html .= '<li><img src="' . esc_url_raw( $thumbnail[0] ) . '" width="75" height="75" /></li>';
|
||||
}
|
||||
|
||||
echo $html; // phpcs:ignore
|
||||
}
|
||||
|
||||
wp_die();
|
||||
}
|
||||
|
||||
/**
|
||||
* The JSON encoded Google fonts data, or false if it cannot be encoded.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public function retrieve_google_font() {
|
||||
check_ajax_referer( 'option_tree', 'nonce' );
|
||||
|
||||
if ( isset( $_POST['field_id'], $_POST['family'] ) ) {
|
||||
|
||||
ot_fetch_google_fonts();
|
||||
|
||||
$field_id = isset( $_POST['field_id'] ) ? sanitize_text_field( wp_unslash( $_POST['field_id'] ) ) : '';
|
||||
$family = isset( $_POST['family'] ) ? sanitize_text_field( wp_unslash( $_POST['family'] ) ) : '';
|
||||
$html = wp_json_encode(
|
||||
array(
|
||||
'variants' => ot_recognized_google_font_variants( $field_id, $family ),
|
||||
'subsets' => ot_recognized_google_font_subsets( $field_id, $family ),
|
||||
)
|
||||
);
|
||||
|
||||
echo $html; // phpcs:ignore
|
||||
}
|
||||
|
||||
wp_die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the media uploader button.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.1
|
||||
*
|
||||
* @param string $translation Translated text.
|
||||
* @param string $text Text to translate.
|
||||
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function change_image_button( $translation, $text, $domain ) {
|
||||
global $pagenow;
|
||||
|
||||
if ( apply_filters( 'ot_theme_options_parent_slug', 'themes.php' ) === $pagenow && 'default' === $domain && 'Insert into post' === $text ) {
|
||||
|
||||
// Once is enough.
|
||||
remove_filter( 'gettext', array( $this, 'ot_change_image_button' ) );
|
||||
return apply_filters( 'ot_upload_text', esc_html__( 'Send to OptionTree', 'hueman' ) );
|
||||
|
||||
}
|
||||
|
||||
return $translation;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiate the OptionTree loader class.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
new OT_Loader();
|
||||
}
|
||||
@@ -0,0 +1,666 @@
|
||||
=== OptionTree ===
|
||||
Contributors: valendesigns
|
||||
Tags: options, theme options, meta boxes, settings
|
||||
Requires at least: 3.8
|
||||
Tested up to: 5.2
|
||||
Stable tag: 2.7.3
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Donate link: https://bit.ly/2TBvksV
|
||||
Requires PHP: 5.3.0
|
||||
|
||||
Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
||||
|
||||
== Description ==
|
||||
|
||||
OptionTree attempts to bridge the gap between WordPress developers, designers and end-users by creating fully responsive option panels and meta boxes with an ease unlike any other plugin. OptionTree has many advanced features with well placed hooks and filters to adjust every aspect of the user experience.
|
||||
|
||||
Build your Theme Options panel locally with an easy to use drag & drop interface and then export a functioning `theme-options.php` file for production use that is i18n translation ready, with your custom text domain automatically inserted.
|
||||
|
||||
And, in just a few simple lines of code, save settings to the database with a unique array ID so none of your Theme Options conflict with other themes that use OptionTree.
|
||||
|
||||
Also, OptionTree now takes full advantage of the new color schemes introduced in WordPress 3.8, it looks and feels built-in.
|
||||
|
||||
#### Theme Integration
|
||||
If you're like me, you want to know how everything works. Download and activate the [OptionTree Theme](https://github.com/valendesigns/option-tree-theme) and see first hand how to integrate OptionTree into your own project. I'll walk you through installing OptionTree and you'll get a chance to see all the various options and filters first hand and in the wild.
|
||||
|
||||
#### Contributing
|
||||
To contribute or report bugs, please go to the [OptionTree Github](https://github.com/valendesigns/option-tree) repository.
|
||||
|
||||
#### Sponsorship
|
||||
OptionTree is a project partly sponsored by <a href="http://themeforest.net/?ref=valendesigns">ThemeForest</a>, the largest WordPress theme marketplace on the web.
|
||||
|
||||
#### Option Types
|
||||
This is a complete list of all the available option types that come shipped with OptionTree.
|
||||
|
||||
* Background
|
||||
* Border
|
||||
* Box Shadow
|
||||
* Category Checkbox
|
||||
* Category Select
|
||||
* Checkbox
|
||||
* Colorpicker
|
||||
* Colorpicker Opacity
|
||||
* CSS
|
||||
* Custom Post Type Checkbox
|
||||
* Custom Post Type Select
|
||||
* Date Picker
|
||||
* Date Time Picker
|
||||
* Dimension
|
||||
* Gallery
|
||||
* Google Fonts
|
||||
* JavaScript
|
||||
* Link Color
|
||||
* List Item
|
||||
* Measurement
|
||||
* Numeric Slider
|
||||
* On/Off
|
||||
* Page Checkbox
|
||||
* Page Select
|
||||
* Post Checkbox
|
||||
* Post Select
|
||||
* Radio
|
||||
* Radio Image
|
||||
* Select
|
||||
* Sidebar Select
|
||||
* Slider
|
||||
* Social Links
|
||||
* Spacing
|
||||
* Tab
|
||||
* Tag Checkbox
|
||||
* Tag Select
|
||||
* Taxonomy Checkbox
|
||||
* Taxonomy Select
|
||||
* Text
|
||||
* Textarea
|
||||
* Textarea Simple
|
||||
* Textblock
|
||||
* Textblock Titled
|
||||
* Typography
|
||||
* Upload
|
||||
|
||||
== Installation ==
|
||||
|
||||
**Plugin Mode**
|
||||
|
||||
1. Upload `option-tree` to the `/wp-content/plugins/` directory
|
||||
1. Activate the plugin through the `Plugins` menu in WordPress
|
||||
1. Click the `OptionTree->Documentation` link in the WordPress admin sidebar menu for further setup assistance.
|
||||
|
||||
**Theme Mode**
|
||||
|
||||
1. Download the latest version of OptionTree and unarchive the `.zip` directory.
|
||||
1. Put the `option-tree` directory in the root of your theme. For example, the server path would be `/wp-content/themes/theme-name/option-tree/`.
|
||||
1. You must deactivate and/or delete the plugin version of OptionTree.
|
||||
1. Add the following code to the beginning of your `functions.php`.
|
||||
|
||||
```
|
||||
/**
|
||||
* Required: set 'ot_theme_mode' filter to true.
|
||||
*/
|
||||
add_filter( 'ot_theme_mode', '__return_true' );
|
||||
|
||||
/**
|
||||
* Required: include OptionTree.
|
||||
*/
|
||||
require( trailingslashit( get_template_directory() ) . 'option-tree/ot-loader.php' );
|
||||
```
|
||||
|
||||
For a list of all the OptionTree UI display filters refer to the `demo-functions.php` file found in the `/assets/theme-mode/` directory of this plugin. This file is the starting point for developing themes with Theme Mode.
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= Is there a demo theme I can install? =
|
||||
|
||||
There sure is, and I'm glad you asked. Download and activate the [OptionTree Theme](https://github.com/valendesigns/option-tree-theme) and get some experience setting up OptionTree on your own with detailed directions and tips.
|
||||
|
||||
= I get errors or a blank screen when I activate the plugin. What's the deal? =
|
||||
|
||||
The most likely scenario is your theme already has OptionTree installed in Theme Mode. And since the plugin and theme version can't both be active at the same time without the sky falling on your head, your site has decided to throw in the towel. If that's not your issue, open up a support request and we'll figure it out together. UPDATE: As of OptionTree 2.4.0 the plugin version will not conflict with the Theme Mode version if they are both 2.4.0 or higher.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Theme Options
|
||||
2. Settings
|
||||
3. Documentation
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.7.3 =
|
||||
* Hotfix - Update regex for Object Injection check to include `+` bypass and PHP serialized classes. props @erwanlr
|
||||
|
||||
= 2.7.2 =
|
||||
* Hotfix - Extend the `unfiltered_html` `iframe` capabilities to support additional `style` attributes.
|
||||
|
||||
= 2.7.1 =
|
||||
* Hotfix - Fix error cannot redeclare `_sanitize_recursive()`. props @shramee
|
||||
* Hotfix - Ensure `iframe` supports the `style` attribute for users with `unfiltered_html` capabilities.
|
||||
* Hotfix - Ensure `noscript` is supported for users with `unfiltered_html` capabilities.
|
||||
|
||||
= 2.7.0 =
|
||||
* Require PHP 5.3+
|
||||
* Fix all PHPCS errors and warnings.
|
||||
* Fix a vulnerability where Object Injection could take place if someone has a valid nonce.
|
||||
* Force all settings to be sanitized and escaped before saving and during display.
|
||||
* Add filter `ot_validate_setting_input_safe` which is used to validate the input value of a custom setting type. All values must be validated!
|
||||
* Add a notice to let users know that a custom setting type is not properly validating saved data and do a best-effort sanitize of the user data before saving it.
|
||||
* Fix issue with Composer autoload and only load OptionTree if we have access to WordPress. props @infomaniac50
|
||||
* Fix deprecated `create_function` notice in PHP 7.2+. props @modesthatred
|
||||
* Fix notice "Only variables should be passed by reference". props @SergeAx
|
||||
* Add `wordpress-plugin` project type to composer file. props @egifford
|
||||
* Removed translation files.
|
||||
* Removed the deprecated XML file import method.
|
||||
* Fix SQL syntax issue. props @ryanlabelle
|
||||
* Fix metabox radio & checkbox style issues. props @ryanlabelle
|
||||
|
||||
= 2.6.0 =
|
||||
* Fix a reflected XSS vulnerability with the `add_list_item` & `add_social_links` Ajax requests.
|
||||
* Fix the Google Fonts URL so it passed the W3 Validator. props @BassemN
|
||||
* Fix `global_admin_css` so it's only enqueued when needed.
|
||||
* Fix `dynamic.css` so that a child theme doesn't load the styles saved to the parent theme.
|
||||
* Add filter `ot_recognized_post_format_meta_boxes` to support additional post formats meta boxes. props @BassemN
|
||||
* Add action `ot_do_settings_fields_before` & `ot_do_settings_fields_after`. props @BassemN, @valendesigns
|
||||
* Add Text Domain to plugin file to fully support the new translate.wordpress.org Language Packs.
|
||||
* Fix notice in PHP 7.0.0 props @Zackio
|
||||
|
||||
= 2.5.5 =
|
||||
* Hotfix - Allow a `0` value to be saved with certain option types. Contributors via github @BassemN.
|
||||
* Hotfix - Stop media from being attached to the OptionTree post type when uploaded from the media manager or customizer. Contributors via github @earnjam, and @valendesigns.
|
||||
* Hotfix - Added filter `ot_load_dynamic_css` to explicitly turn the feature off if desired.
|
||||
* Hotfix - Stopped `dynamic.css` created with other themes from being loaded elsewhere.
|
||||
|
||||
= 2.5.4 =
|
||||
* Hotfix - Support for WordPress 4.2 term splitting.
|
||||
* Hotfix - Removed any potential XSS security issues with `add_query_arg` by escaping it.
|
||||
* Hotfix - Fixed an issue where Visual Composer was indirectly destroying OptionTree meta box values.
|
||||
* Hotfix - Fixed an issue where the select field value was not visible. Contributors via github @sabbirk15.
|
||||
|
||||
= 2.5.3 =
|
||||
* Hotfix - Added `inherit` fallback to the `border` option type in dynamic.css.
|
||||
* Hotfix - Added `none` fallback to the `box-shadow` option type in dynamic.css.
|
||||
* Hotfix - Added `inherit` fallback to the `colorpicker` option type in dynamic.css.
|
||||
* Hotfix - Added `inherit` fallback to the `colorpicker-opacity` option type in dynamic.css.
|
||||
* Hotfix - Added filter `ot_insert_css_with_markers_fallback` to filter the `dynamic.css` fallback value.
|
||||
* Hotfix - Added filter `ot_type_radio_image_attributes` to filter the image attributes for each radio choice. Contributors via github @BassemN, and @valendesigns.
|
||||
* Hotfix - Refactored `ot_insert_css_with_markers` to remove confusing & unnecessary PHP statements and fix whitespace.
|
||||
* Hotfix - Fixed an issue in `ot_insert_css_with_markers` where the `$option_type` variable was not being set properly.
|
||||
* Hotfix - Fixed an issue where having multiple Google Fonts option types caused the "Add Google Font" button to insert multiple dropdowns.
|
||||
|
||||
= 2.5.2 =
|
||||
* Hotfix - Added `inherit` fallback to the `link-color` option type in dynamic.css.
|
||||
* Hotfix - Remove `$.browser.msie` JS error caused by function being deprecated.
|
||||
* Hotfix - Change `hover` to `mouseenter mouseleave` to stop jQuery migrate error message.
|
||||
* Hotfix - Don't allow duplicate Google Fonts in the `ot-google-fonts-css` enqueue.
|
||||
* Hotfix - Fixed an issue with the CSS and JavaScript option types not being initiating inside of tabs.
|
||||
* Hotfix - Fixed metabox tab styles for mobile.
|
||||
* Hotfix - Separate the post formats JS so it does not interfere with the default behavior and loads only as needed.
|
||||
* Hotfix - Adding the `not-sortable` class to the List Item option type will remove the sortable feature for that option.
|
||||
|
||||
= 2.5.1 =
|
||||
* Hotfix - Overhaul the Colorpicker Opacity option type so it saves rgba values, not arrays.
|
||||
* Hotfix - Added the ability to set opacity on any colorpicker with the `ot-colorpicker-opacity` class.
|
||||
* Hotfix - Don't use `esc_url_raw` to filter the Upload option type when it's saving an attachment ID. Contributors via github @RistoNiinemets.
|
||||
* Hotfix - Show an error message to user if unable to write to the `dynamic.css` file. Contributors via github @johnh10, and @valendesigns.
|
||||
* Hotfix - Force the `ot_google_fonts` array to be rebuilt when switching between themes.
|
||||
* Hotfix - Stop theme check from nagging about using `add_menu_page` in `ot-cleanup-api.php`.
|
||||
|
||||
= 2.5.0 =
|
||||
* Added the Google Fonts option type. Contributors via github @maimairel, and @valendesigns.
|
||||
* Added the Border option type. Contributors via github @doitmax, and @valendesigns.
|
||||
* Added the Box Shadow option type. Contributors via github @doitmax, and @valendesigns.
|
||||
* Added the Colorpicker Opacity option type. Contributors via github @doitmax, and @valendesigns.
|
||||
* Added the Dimension option type. Contributors via github @doitmax, and @valendesigns.
|
||||
* Added the JavaScript option type.
|
||||
* Added the Link Color option type. Contributors via github @doitmax, and @valendesigns.
|
||||
* Added the Spacing option type. Contributors via github @doitmax, and @valendesigns.
|
||||
* Fixed an issue where the Colorpicker was not parsing conditions on `change` or `clear`.
|
||||
* Fixed the Colorpicker styles on mobile devices.
|
||||
* Show the Colorpicker setting ID inside the error message string when the value is invalid.
|
||||
* Added an 'on change' trigger to the Numeric Slider's hidden input. Contributors via github @cubell.
|
||||
* Stop Theme Check from complaining about the `register_post_type()` function being used in Theme Mode.
|
||||
* Added styles that clean up the appearance of the included Font Awesome icons in section tabs.
|
||||
* Fixed jQuery UI style conflicts created by the WP Review plugin.
|
||||
* Changed the sanitization function from `sanitize_text_field` to `esc_url_raw` for the Upload option type.
|
||||
* Added filter `ot_dequeue_jquery_ui_css_screen_ids` to dequeue `jquery-ui-css` by screen ID.
|
||||
* Added filter `ot_on_off_switch_on_value` to filter the value of the On button. Contributors via github @BassemN, and @valendesigns.
|
||||
* Added filter `ot_on_off_switch_on_label` to filter the label of the On button. Contributors via github @BassemN, and @valendesigns.
|
||||
* Added filter `ot_on_off_switch_off_value` to filter the value of the Off button. Contributors via github @BassemN, and @valendesigns.
|
||||
* Added filter `ot_on_off_switch_off_label` to filter the label of the Off button. Contributors via github @BassemN, and @valendesigns.
|
||||
* Added filter `ot_on_off_switch_width` to filter the width of the On/Off switch.
|
||||
* Added filter `ot_type_date_picker_readonly` to filter the addition of the readonly attribute.
|
||||
* Added filter `ot_type_date_time_picker_readonly` to filter the addition of the readonly attribute.
|
||||
* Added filter `ot_admin_menu_priority` to filter the `admin_menu` action hook priority.
|
||||
* Added Estonian translation. Contributors via github @tjuris, and @RistoNiinemets.
|
||||
* Fixed an issue where changes to `theme-options.php` required a second page load.
|
||||
* Fixed the clean up script, it only displays when there's something to clean up. No more menu item!
|
||||
* Update demo files with the latest option types.
|
||||
* Changed where `ot_css_file_paths` is saved when `is_multisite` for better `dynamic.css` file support.
|
||||
* Changed the default `dynamic.css` file path in multisite to be `dynamic-{current-blog-id}.css`.
|
||||
|
||||
= 2.4.6 =
|
||||
* Hotfix - Added a clean up script to consolidate orphaned media posts and remove the old and unused `wp_option_tree` table.
|
||||
* Hotfix - Fixed an issue where `ot_get_media_post_ID()` was never able to set the value of the `ot_media_post_ID` option because it was already set to empty. Causing the `ot_create_media_post()` function to create multiple media posts.
|
||||
|
||||
= 2.4.5 =
|
||||
* Hotfix - Fixed an issue where `ot_get_media_post_ID()` was setting the value of the `ot_media_post_ID` option to `null`. Causing the `ot_create_media_post()` function to create multiple media posts. A clean up script will be added to `2.5.0`.
|
||||
|
||||
= 2.4.4 =
|
||||
* Hotfix - Fixed undefined index caused by shorthand conditional.
|
||||
* Hotfix - Fixed jQuery UI style conflicts created by the Easy Digital Downloads plugin.
|
||||
* Hotfix - Added placeholder to background-image. Contributors via github @BassemN.
|
||||
|
||||
= 2.4.3 =
|
||||
* Hotfix - WordPress 4.0 compatible.
|
||||
* Hotfix - Fixed an issue where all media was being attached to the default OptionTree media post.
|
||||
* Hotfix - Removed the deprecated `screen_icon()` function.
|
||||
* Hotfix - Fixed the `ot_line_height_range_interval` filter being misnamed as `ot_line_height_unit_type`. Contributors via github @youri--.
|
||||
* Hotfix - Fixed a conflict with "Frontend Publishing Pro" when using the media uploader on the front-end.
|
||||
* Hotfix - Increase condition performance. Contributors via github @designst.
|
||||
* Hotfix - Add custom style classes to list-item settings. Contributors via github @designst.
|
||||
* Hotfix - Check for `post_title` instead of `post_name` in `ot_get_media_post_ID()`. Contributors via github @clifgriffin.
|
||||
* Hotfix - Store the return value of `ot_get_media_post_ID()` in the options table as `ot_media_post_ID`.
|
||||
* Hotfix - Added padding to List Items options to reflect the same UI as individual options. Contributors via github @valendesigns and @designst.
|
||||
* Hotfix - Fixed a bug that caused the Social Links option type to not properly import.
|
||||
|
||||
= 2.4.2 =
|
||||
* Hotfix - Fixed a PHP notice that was created when `background-size` in the Background option type is undefined.
|
||||
* Hotfix - Fixed an issue with the Upload option type, in attachment ID mode, not storing its value.
|
||||
* Hotfix - Replaced `load_template` with `require` throught the documentation.
|
||||
* Hotfix - Added a settings ID auto-fill that is based on the text of the settings label in the Theme Options UI Builder. Contributors via github @valendesigns and @Ore4444.
|
||||
* Hotfix - Added filter `ot_override_forced_textarea_simple` to allow the Textarea option type to be moved in the DOM and not replaced with the Textarea Simple option type in meta boxes and list items.
|
||||
|
||||
= 2.4.1 =
|
||||
* Hotfix - Fixed a typo in the demo Theme Options related to the `social-links`.
|
||||
* Hotfix - Fixed the language directory path conflict between IIS and Linux while in Theme Mode.
|
||||
* Hotfix - Fixed a style issue where select fields would overflow their parent elements.
|
||||
* Hotfix - Fixed a PHP notice that was created when the Measurement option type did not have a saved value.
|
||||
|
||||
= 2.4.0 =
|
||||
* Added filter 'ot_post_formats' which loads meta boxes specifically for post formats.
|
||||
* Added the Social Links option type.
|
||||
* Fixed OptionTree being conflicted due to having both the plugin and theme version activated. Contributors via github @valendesigns and @bitcommit.
|
||||
* Added an admin notice when the UI Builder is being overridden by custom theme options.
|
||||
* Allow the Upload option type to be stored as an attachment ID by adding `ot-upload-attachment-id` to the elements `class` attribute. Contributors via github @valendesigns and @krisarsov.
|
||||
* Fixed an issue with the CSS option type not showing the Ace editor in a metabox that is broken into tabbed content.
|
||||
* Fixed missing option type translation strings. Contributors via github @RistoNiinemets.
|
||||
* Replaced mysql functions with the wpdb equivalent. Contributors via github @joshlevinson.
|
||||
* Fixed search order of the `contains` condition string. Contributors via github @designst.
|
||||
* Added meta box field wrapper class if a custom field class is defined in the settings. Contributors via github @designst.
|
||||
* Added filter 'ot_type_select_choices' to dynamically change select choices. Contributors via github @maimairel and @valendesigns.
|
||||
* Fixed a bug that added an unnecessary directory separator to the `load_theme_textdomain()` `$path` variable. Contributors via github @PatrickDelancy and @valendesigns.
|
||||
* Fixed the state of metabox radio buttons after a Drag & Drop event. Contributors via github @themovation and @valendesigns.
|
||||
* Fixed conditions not working correctly within list items.
|
||||
* Fixed the min-height issue when using tabs in metaboxes.
|
||||
* Added filter `ot_recognized_font_sizes` to dynamically change the font sizes by field ID.
|
||||
* Added filter `ot_recognized_letter_spacing` to dynamically change the letter spacing by field ID.
|
||||
* Added filter `ot_recognized_line_heights` to dynamically change the line heights by field ID.
|
||||
* Fixed a style issue where list item labels in metaboxes were not displaying correctly.
|
||||
* Fixed an issue where the WooCommerce plugin would alter the style of metabox tabs on product pages.
|
||||
|
||||
= 2.3.4 =
|
||||
* Hotfix - Fixed an issue where condition number values were being treated like strings and not returning a correct boolean response.
|
||||
|
||||
= 2.3.3 =
|
||||
* Hotfix - Fixed subfolder compatibility with versions of Windows that use backslashes instead of forward slashes. Contributors via github @primozcigler and @valendesigns.
|
||||
* Hotfix - Fixed missing text domain in demo files. Contributors via github @jetonr.
|
||||
* Hotfix - Added filter `ot_migrate_settings_id` to migrate themes that used `option_tree_settings` and now use a custom settings ID.
|
||||
* Hotfix - Added filter `ot_migrate_options_id` to migrate themes that used `option_tree` and now use a custom options ID.
|
||||
* Hotfix - Added filter `ot_migrate_layouts_id` to migrate themes that used `option_tree_layouts` and now use a custom layouts ID.
|
||||
|
||||
= 2.3.2 =
|
||||
* Hotfix - Fixed an issue with the `ot_create_media_post` function creating multiple `option-tree` posts.
|
||||
* Hotfix - Change the icon used by the layout management option type to differentiate it from the edit button.
|
||||
* Hotfix - Suppress PHP warning in the Background option type "Invalid argument supplied for foreach()". Contributors via github @tomkwok.
|
||||
* Hotfix - Added filter `ot_type_date_picker_date_format` to change the date format of the Date Picker option type.
|
||||
* Hotfix - Added filter `ot_type_date_time_picker_date_format` to change the date format of the Date Time Picker option type.
|
||||
|
||||
= 2.3.1 =
|
||||
* Hotfix - Fixed a bug with the Gallery option type that would show attachments in the media window when none had been added yet.
|
||||
* Hotfix - Added the option to save the Gallery as a shortcode by adding `ot-gallery-shortcode` to the elements `class` attribute.
|
||||
* Hotfix - Fixed conditions not being effective in List Items directly after clicking "Add New". Contributors via github @bitcommit.
|
||||
|
||||
= 2.3.0 =
|
||||
* Added the Tab option type.
|
||||
* Added Ace Editor to the CSS option type. Contributors via github @imangm and @valendesigns.
|
||||
* Added support for WordPress 3.8 color schemes.
|
||||
* Added support for RTL languages. Contributors via github @omid-khd and @valendesigns.
|
||||
* Added actions before and after the enqueue styles and scripts.
|
||||
* Added Date Picker option type. Contributors via github @jetonr and @valendesigns.
|
||||
* Added Date Time Picker option type. Contributors via github @jetonr and @valendesigns.
|
||||
* Added filter 'ot_list_item_title_label' to change the label for a List Item's required title field.
|
||||
* Added filter 'ot_list_item_title_desc' to change the description for a List Item's required title field.
|
||||
* Added filter 'ot_options_id' to change the 'option_tree' option ID to a unique value.
|
||||
* Added filter 'ot_settings_id' to change the 'option_tree_settings' option ID to a unique value.
|
||||
* Added filter 'ot_layouts_id' to change the 'option_tree_layouts' option ID to a unique value.
|
||||
* Added filter 'ot_header_logo_link' to change the logo link inside the header of OptionTree.
|
||||
* Added filter 'ot_header_version_text' to change the version text inside the header of OptionTree.
|
||||
* Added action 'ot_header_list' to add additional theme specific list items to the header of OptionTree.
|
||||
* Added filter 'ot_upload_text' to change the "Send to OptionTree" text.
|
||||
* Added the CSS Class field value to the parent `.format-settings` div in addition to the class being added to the element. Each class is now appended with `-wrap`.
|
||||
* Added support for [Composer](https://github.com/composer/composer). Contributors via github @designst.
|
||||
* Added support for adding I18n text domains to the exported `theme-options.php` file.
|
||||
* Fixed a bug that kept the UI from displaying when using the `ot_type_background_size_choices` filter.
|
||||
* Fixed a bug that caused the Gallery option type to save a single space instead of `null`.
|
||||
* Fixed the return value of the Background, Measurement, and Typography option types. They now return `null` if no values are saved to the array.
|
||||
* Fixed a bug that resulted in a PHP warning if the choices array was set to an empty string.
|
||||
* Updated the documentation, including this `readme.txt` and a new demo [OptionTree Theme](https://github.com/valendesigns/option-tree-theme) to parallel OptionTree.
|
||||
* Added filter 'ot_type_radio_image_src' which allows the Radio Image option type source URI to be changed. Contributors via github @bitcommit.
|
||||
|
||||
= 2.2.3 =
|
||||
* Hotfix - Allow empty condition values. For example, `field_id:is()` or `field_id:not()` would now be valid syntax.
|
||||
* Hotfix - Fixed a bug in the `init_upload_fix` JavaScript method.
|
||||
* Hotfix - Fixed a bug in the `url_exists` javaScript method. The code will no longer will check if a URL exists on another domain.
|
||||
|
||||
= 2.2.2 =
|
||||
* Hotfix - Added support for both upper and lower case conditions operator.
|
||||
* Hotfix - Updated the color and font size of inline code.
|
||||
* Hotfix - Fix an issue with IE filter and updated the style of the On/Off option type.
|
||||
* Hotfix - Added opacity to radio images to improve distinction. Contributors via github @jetonr.
|
||||
|
||||
= 2.2.1 =
|
||||
* Hotfix - Fixed a UI bug that caused the layouts input to cover the wp menu.
|
||||
* Hotfix - Moved the screen shots to the WordPress SVN assets directory.
|
||||
|
||||
= 2.2.0 =
|
||||
* Added the Gallery option type.
|
||||
* Added the On/Off option type.
|
||||
* Replaced the old Color Picker with the default WP Color Picker.
|
||||
* Added UI support for WordPress 3.8. Contributors via github @AlxMedia, and @valendesigns.
|
||||
* Added support for conditional toggling of settings fields. Contributors via github @maimairel, @valendesigns, @doitmax, and @imangm.
|
||||
* Replaced the OptionTree image icon with a font version.
|
||||
* Added 'background-size' to the Background option type.
|
||||
* Added fallback text when displaying posts without titles in various option types.
|
||||
* Added filter 'ot_recognized_background_fields' to show/hide fields for background option types.
|
||||
* Added filter 'ot_filter_description' that allows the theme option descriptions to be filtered before being displayed.
|
||||
* Added subfolder compatibility in theme mode. Contributors via github @doitmax, and @valendesigns.
|
||||
* Fixed a bug caused by using 'home_url' when loading dynamic CSS files.
|
||||
* Fixed an issue where you could not save metabox text field values as "0". Contributors via github @sparkdevelopment, and @valendesigns.
|
||||
* Fixed the broken localization directory path in theme mode. Contributors via github @youri--, and @valendesigns.
|
||||
* Fixed missing custom class for the Numeric Slider. Contributors via github @doitmax.
|
||||
* Added filter 'ot_type_category_checkbox_query' which allows you to filter the get_categories() args for Category Checkbox.
|
||||
* Added filter 'ot_type_category_select_query' which allows you to filter the get_categories() args for Category Select.
|
||||
* Added filter 'ot_type_taxonomy_checkbox_query' which allows you to filter the get_categories() args for Taxonomy Checkbox.
|
||||
* Added filter 'ot_type_taxonomy_select_query' which allows you to filter the get_categories() args for Taxonomy Select.
|
||||
* Added the 'ot_echo_option' function. Contributors via github @joshlevinson.
|
||||
* Added filter 'ot_theme_options_contextual_help' which allows you to filter the Contextual Help on the Theme Options page.
|
||||
* Added filter 'ot_theme_options_sections' which allows you to filter the Sections on the Theme Options page. Contributors via github @joshlevinson.
|
||||
* Added filter 'ot_theme_options_settings' which allows you to filter the Settings on the Theme Options page. Contributors via github @joshlevinson.
|
||||
|
||||
= 2.1.4 =
|
||||
* Hotfix - Fixed the Numeric Slider not work inside of a newly added List item.
|
||||
* Hotfix - Fixed the numeric slider fallback value being set to 0, it now becomes the minimum value if no standard is set.
|
||||
* Hotfix - Allow single quotes in std and choice value when exporting theme-options.php. Contributors via github @maimairel.
|
||||
* Hotfix - Additional Themecheck bypass for required functions. Contributors via github @maimairel.
|
||||
* Hotfix - Fixed post meta information being lost when loading revisions. Contributors via github @live-mesh.
|
||||
* Hotfix - Removed template queries in option types. Contributors via github @live-mesh.
|
||||
|
||||
= 2.1.3 =
|
||||
* Hotfix - Loading OptionTree on the 'init' action proved to be wrong, it now loads on 'after_setup_theme'.
|
||||
* Hotfix - Layouts were not being imported properly due to using the wrong path variable.
|
||||
|
||||
= 2.1.2 =
|
||||
* Hotfix - Fixed a JS mistake that caused upload in list items and sliders to not open the media uploader until saved first.
|
||||
* Hotfix - Load OptionTree on the 'init' action, which allows the UI filters to properly function when not in theme mode.
|
||||
|
||||
= 2.1.1 =
|
||||
* Hotfix - The OT_SHOW_SETTINGS_EXPORT constant was incorrectly set to false as the default.
|
||||
|
||||
= 2.1 =
|
||||
* Added support for WordPress 3.6.
|
||||
* UI got a small but needed update, and is now more inline with WordPress.
|
||||
* Added WPML support for the Text, Textarea, and Textarea Simple option types, and within list items; even after drag & drop.
|
||||
* Upload now uses the media uploader introduced in WordPress 3.5. Contributors via github @htvu, @maimairel, and @valendesigns.
|
||||
* Added a horizontal Numeric Slider option type. Contributors via github @maimairel and @valendesigns.
|
||||
* Added a Sidebar Select option type. Contributors via github @maimairel.
|
||||
* Removed additional deprecated assigning of return value in PHP.
|
||||
* Fix missing "Send to OptionTree" button in CPT. Contributors via github @jomaddim.
|
||||
* Fix option types that use $count instead of an array key to select the option value.
|
||||
* Created functions to register the Theme Options & Settings pages, and with better filtering.
|
||||
* Added relative path support for Radio Image choices.
|
||||
* Added dynamic replacement of 'OT_URL' & 'OT_THEME_URL' in the Radio Image source path.
|
||||
* Make '0' possible as a field value. Validate for empty strings instead of empty(). Contributors via github @maimairel.
|
||||
* The 'ot_theme_options_capability' filter is now working for different capabilities like editor.
|
||||
* The 'ot_display_by_type' filter is now being assigned to a value.
|
||||
* Added filter 'ot_show_options_ui' which allows you to hide the Theme Options UI Builder.
|
||||
* Added filter 'ot_show_settings_import' which allows you to hide the Settings Import options on the Import page.
|
||||
* Added filter 'ot_show_settings_export' which allows you to hide the Settings Export options on the Export page.
|
||||
* Added filter 'ot_show_docs' which allows you to hide the Documentation.
|
||||
* Added filter 'ot_use_theme_options' which allows you to hide the OptionTree Theme Option page (not recommended for beginners).
|
||||
* Added filter 'ot_list_item_description' which allows you to change the default list item description text.
|
||||
* Added filter 'ot_type_custom_post_type_checkbox_query' which allows you to filter the get_posts() args for Custom Post Type Checkbox.
|
||||
* Added filter 'ot_type_custom_post_type_select_query' which allows you to filter the get_posts() args for Custom Post Type Select.
|
||||
* Added filter 'ot_type_page_checkbox_query' which allows you to filter the get_posts() args for Page Checkbox.
|
||||
* Added filter 'ot_type_page_select_query' which allows you to filter the get_posts() args for Page Select.
|
||||
* Added filter 'ot_type_post_checkbox_query' which allows you to filter the get_posts() args for Post Checkbox.
|
||||
* Added filter 'ot_type_post_select_query' which allows you to filter the get_posts() args for Post Select.
|
||||
|
||||
= 2.0.16 =
|
||||
* Fixed an urgent JS regression bug that caused the upload option type to break. Code contributed by @anonumus via github.
|
||||
* Added 'font-color' to the typography filter.
|
||||
|
||||
= 2.0.15 =
|
||||
* Added support for Child Theme mode.
|
||||
* Improved handling of standard values when settings are written manually.
|
||||
* Add filter for CSS insertion value.
|
||||
* Added 'ot_before_theme_options_save' action hook.
|
||||
* Fix 'indexOf' JS error when upload is closed without uploading.
|
||||
* Add textarea std value when option type is 'textarea', 'textarea-simple', or 'css'.
|
||||
* Remove load_template and revert back to include_once.
|
||||
* Fixed dynamic.css regression from 2.0.13 that caused the file to not save.
|
||||
|
||||
= 2.0.14 =
|
||||
* Removed deprecated assigning of return value in PHP.
|
||||
* Patch to fix PHP notice regression with the use of load_template in a plugin after Theme Check update.
|
||||
* Fixed missing required arguments in OT_Loader::add_layout.
|
||||
* Removed esc_attr() on font-family check.
|
||||
* Added a 'ot_theme_options_parent_slug' filter in ot-ui-theme-options.php
|
||||
* Fixed WP_Error from the use of wp_get_remote() instead of file_get_contents().
|
||||
|
||||
= 2.0.13 =
|
||||
* Removed almost all of the Theme Check nag messages when in 'ot_theme_mode'.
|
||||
* Fix an issue where Media Upload stopped working on some servers.
|
||||
|
||||
= 2.0.12 =
|
||||
* Added additional filters to the array that builds the Theme Option UI.
|
||||
* Made option-tree post type private.
|
||||
* Revert capabilities back to manage_options in ot-ui-admin.php.
|
||||
* Upload now sends the URL of the selected image size to OptionTree.
|
||||
* Added new range interval filter to font-size, letter-spacing, & line-height.
|
||||
* Allow Typography fields to be filtered out of the UI.
|
||||
|
||||
= 2.0.11 =
|
||||
* Added filters to the array that builds the Theme Option UI.
|
||||
* Added .format-setting-wrap div to allow for complex CSS layouts.
|
||||
* Added better namespacing for the Colorpicker option type.
|
||||
* Fixed theme-options.php export where it was adding an extra comma.
|
||||
|
||||
= 2.0.10 =
|
||||
* Fixed a bug where the Textarea row count wasn't working for List Items.
|
||||
* Added an apply_filter to the exported theme-options.php file.
|
||||
* Added CSS id's to tabs and settings.
|
||||
* Allow "New Layout" section to be hidden on the theme options page via a filter.
|
||||
* Fixed a bug where the Colorpicker was not closing in List Items.
|
||||
* Change capabilities from manage_options to edit_theme_options.
|
||||
* Remove Textblock title in List Items & Metaboxes.
|
||||
* Fixed a List Item bug that incorrectly added ID's based on counting objects - submitted by Spark
|
||||
* Fixed incorrect text domain paths for both plugin and theme mode.
|
||||
* Fixed a bug with UI Sortable not properly calculating the container height.
|
||||
* Fixed Select dropdown selector bug - submitted by Manfred Haltner
|
||||
* Fixed Radio Image remove class bug - submitted by designst
|
||||
* Added new typography fields - submitted by darknailblue
|
||||
* Added dynamic CSS support for new typography fields.
|
||||
* Added new filters to typography fields, including low/high range & unit types.
|
||||
|
||||
= 2.0.9 =
|
||||
* Fixed the issue where the Textarea Simple and CSS option types were mysteriously being ran through wpautop.
|
||||
* Added missing class setting to Textarea, Textarea Simple, & CSS option types.
|
||||
* Fixed theme-options.php exported array where label values were not correct.
|
||||
* Change GET to POST for all AJAX calls to fix a bug where some servers would not allow long strings to be passed in GET variables.
|
||||
* Added the 'ot_after_validate_setting' filter to the validation function.
|
||||
* Added $field_id to the ot_validate_setting() for more precise filtering.
|
||||
* Added the ot_reverse_wpautop() function that you can run input through just incase you need it.
|
||||
* Updated the docs to include information on why WYSIWYG editors are not allowed in meta boxes and that they revert to a Textarea Simple.
|
||||
* Update option-tree.pot file.
|
||||
|
||||
= 2.0.8 =
|
||||
* Add auto import for backwards compatibility of old 1.x files.
|
||||
* Added the ability to export settings into a fully functional theme-options.php.
|
||||
* Fix typo in docs regarding the filter demo code.
|
||||
* Removed slashes in the section and contextual help titles.
|
||||
* Made colorpicker input field alignment more cross browser compatible.
|
||||
|
||||
= 2.0.7 =
|
||||
* Fixed the load order to be compatible with 1.x version themes that think the get_option_tree() function doesn't exist yet.
|
||||
* Tested and compatible with Cudazi themes, but the nag message is still visible.
|
||||
|
||||
= 2.0.6 =
|
||||
* Run the 'option_tree' array through validation when importing data and layouts.
|
||||
* Fix a bug where list items and sliders were not allowing the user to select the input field.
|
||||
* Add a filter that allows you to not load resources for meta boxes if you're not going to use them.
|
||||
* Update option-tree.pot file.
|
||||
|
||||
= 2.0.5 =
|
||||
* Change the way the 'option_tree_settings' array validates. Strip out those damn slashes!
|
||||
|
||||
= 2.0.4 =
|
||||
* Run the 'option_tree' array through validation when upgrading from the 1.0 branch to the 2.0 branch for the first time.
|
||||
* Fix a typo in the slider array where textarea's were not saving the first time due to an incorrect array key.
|
||||
|
||||
= 2.0.3 =
|
||||
* Had an incorrect conditional statement causing an issue where the plugin was attempting to create the 'option-tree' image attachment page, even though it was already created.
|
||||
* The above also fixed a conflict with 'The Events Calendar' plugin.
|
||||
|
||||
= 2.0.2 =
|
||||
* Added I18n support, let the translations begin. The option-tree.pot file is inside the languages directory.
|
||||
* Trim whitespace on imported choices array.
|
||||
* Fixed the CSS insert function not having a value to save.
|
||||
|
||||
= 2.0.1 =
|
||||
* Import from table was not mapping settings correctly. It is now.
|
||||
|
||||
= 2.0 =
|
||||
* Complete rewrite form the ground up.
|
||||
* Better Theme Options UI Builder.
|
||||
* New in-plugin documentation.
|
||||
* Brand new responsive UI.
|
||||
* Add new option types, most notable the List Item which should eventually replace the Slider.
|
||||
* Added the simpler ot_get_option() function to eventually replace get_option_tree().
|
||||
* Added support for Meta Boxes.
|
||||
* Added Theme Mode where you can now include the plugin directly in your theme.
|
||||
* Better validation on saved data.
|
||||
* Simplified the import process.
|
||||
* Added support for contextual help.
|
||||
* Permanently move the Theme Option to the Appearance tab.
|
||||
* Added a ton of filters.
|
||||
* Made huge improvements to the code base and tested rigorously.
|
||||
|
||||
= 1.1.8.1 =
|
||||
* Removed get_option_tree() in the WordPress admin area due to theme conflicts.
|
||||
* Removed demo files in the assets folder at the request of WordPress
|
||||
|
||||
= 1.1.8 =
|
||||
* Fixed scrolling issue on extra tall pages
|
||||
* Added ability to show/hide settings & documentation via the User Profile page.
|
||||
* Added Background option type.
|
||||
* Added Typography option type.
|
||||
* Added CSS option type.
|
||||
* Better looking selects with 1=Yes,2=No where '1' is the value and 'Yes' is the text in the select.
|
||||
* Made the AJAX message CSS more prominent.
|
||||
* functions.load.php will now only load option type functions if viewing an OT admin page.
|
||||
* Deregistered the custom jQuery UI in the 'Cispm Mail Contact' plugin when viewing an OptionTree page.
|
||||
* Can now save layouts from the Theme Options page.
|
||||
* You can now change the slider fields by targeting a specific "Option Key"
|
||||
* Modified upload for situations where you manually enter a relative path
|
||||
* Allow get_option_tree() function to be used in WP admin
|
||||
* Changed permissions to edit_theme_options
|
||||
|
||||
= 1.1.7.1 =
|
||||
* Revert functions.load.php, will fix and update in next version
|
||||
|
||||
= 1.1.7 =
|
||||
* Added layout (theme variation) support with save/delete/activate/import/export capabilities.
|
||||
* Allow layout change on Theme Options page.
|
||||
* Full Multisite compatibility by manually adding xml mime type for import options.
|
||||
* Replaced eregi() with preg_match() for 5.3+ compatibility.
|
||||
* Changed test data in the assets directory for new layout option.
|
||||
* Made it so when the slider & upload image changes it's reflected on blur.
|
||||
* Gave the slider image an upload button.
|
||||
* Added do_action('option_tree_import_data') to option_tree_import_data() function before exit.
|
||||
* Added do_action('option_tree_array_save') to option_tree_array_save() function before exit.
|
||||
* Added do_action('option_tree_save_layout') to option_tree_save_layout() function before exit.
|
||||
* Added do_action('option_tree_delete_layout') to option_tree_delete_layout() function before exit.
|
||||
* Added do_action('option_tree_activate_layout') to option_tree_activate_layout() function before exit.
|
||||
* Added do_action('option_tree_import_layout') to option_tree_import_layout() function before redirect.
|
||||
* Added do_action('option_tree_admin_header') hook before all admin pages.
|
||||
* Fixed bug where users could add a color without a hash.
|
||||
* Only load option type function on Theme Options page
|
||||
* Loading resources with absolute paths, no longer relative.
|
||||
* Fixed a bug with uploader creating extra option-tree draft pages.
|
||||
* Fixed slider toggle bug, now the sliders close when you open another or create new slide.
|
||||
|
||||
= 1.1.6 =
|
||||
* Theme Integration added.
|
||||
* Made the upload XML file openbase_dir compliant.
|
||||
|
||||
= 1.1.5 =
|
||||
* Fixed multiple sliders issue
|
||||
|
||||
= 1.1.4 =
|
||||
* Patch for get_option_tree() $is_array being false and still returning an array
|
||||
|
||||
= 1.1.3 =
|
||||
* Added Slider option type with filter for changing the optional fields
|
||||
* Fixed the text displayed for Measurement option type after options are reset
|
||||
* Added filter to measurement units
|
||||
* Code cleanup in the option_tree_array_save() function
|
||||
* Fixed double quotes on front-end display
|
||||
|
||||
= 1.1.2 =
|
||||
* Fixed double quotes in Textarea option type
|
||||
* Added Measurement option type for CSS values
|
||||
* Fixed Post option type only returning 5 items
|
||||
* Added a scrolling window for checkboxes > 10
|
||||
|
||||
= 1.1.1 =
|
||||
* Fixed the 'remove' icon from showing when nothing's uploaded
|
||||
|
||||
= 1.1 =
|
||||
* Fixed the Undefined index: notices when WP_DEBUG is set to true
|
||||
|
||||
= 1.0.0 =
|
||||
* Initial version
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 2.7.0 =
|
||||
All custom setting types must use the `ot_validate_setting_input_safe` filter to sanitize user input data. OptionTree will attempt to sanitize the data, but data loss could happen with custom setting types when saving — so please update them. Additionally, please install OptionTree on a test server, or backup your database, before upgrading your live site. This version contains breaking changes!
|
||||
|
||||
= 2.3.0 =
|
||||
As with each major release, please install OptionTree on a test server before upgrading your live site.
|
||||
|
||||
= 2.1.4 =
|
||||
If you're not the developer of this theme, please ask them to test compatibility with version 2.1 before upgrading. If you are the developer, I urge you to do the same in a controlled environment.
|
||||
|
||||
= 2.0.16 =
|
||||
There was an issue with the upload option type's JavaScript not allowing anything other than images to be sent to the editor. This urgent issue is now fixed and why this version is light on changes.
|
||||
|
||||
= 2.0.12 =
|
||||
The plugin has undertaken a complete rebuild! If you are not the theme developer, I urge you to contact that person before you upgrade and ask them to test the themes compatibility.
|
||||
|
||||
= 1.1.8.1 =
|
||||
Removed get_option_tree() in the WordPress admin area due to theme conflicts.
|
||||
|
||||
= 1.1.8 =
|
||||
Added Typography, Background, & CSS option types. Lots of way to extend them, as well.
|
||||
|
||||
= 1.1.7 =
|
||||
Lots of additions, none critical just fun. Added layouts & upload to slider. As well, started including action hooks for extending and integrating with other plugins.
|
||||
|
||||
= 1.1.6 =
|
||||
Added theme integration for developers. It's now possible to have a default XML file included in your theme to populate the theme options and hide the settings and docs pages. Read more about this in the plugins built in documentation.
|
||||
|
||||
= 1.1.5 =
|
||||
Having multiple sliders caused a naming collision in the JavaScript and is now fixed. Upgrade ASAP to have multiple sliders available in the UI.
|
||||
|
||||
= 1.1.4 =
|
||||
Fixed the returned value of the get_option_tree() function when $is_array is set to false. If you have created any slider or measurement option types please read the updated documentation for examples on how to use them in your theme.
|
||||