lucatume / wp-wrappers
This package is abandoned and no longer maintained.
No replacement package was suggested.
WordPress wrappers to streamline development of themes and plugins.
2.0.5
2014-09-18 14:04 UTC
Requires
- php: >=5.3.0
- lucatume/tdd-helpers: ~2.0
- lucatume/wp-utils: ~2.0
Requires (Dev)
- codeception/codeception: 1.8.*
- phpspec/phpspec: 2.0.*@dev
This package is not auto-updated.
Last update: 2016-12-08 10:30:45 UTC
README
A small set of classes wrapping WordPress common operations.
Options
This class allows for creating, reading and updating an options stored in the database. It's a wrapper around the update_option
and load_option
methods.
It will create and read array options and keys will be made available using the camelBack format.
// get the 'my_theme' option from the database
$the = tad_OptionWrapper::on('my_theme');
// if the option defines 'header_text', 'footer_color' and 'sidebar_position'
$headerText = $the->headerText;
$footerColor = $the->footerColor;
$sidebarPosition = $the->sidebarPosition;
Serialized tad_OptionWrapper
Much like the tad_OptionWrapper class but without writing support at the moment. Actually feeding it a non-serialized option will not be a problem.
Theme support
Allows for quick addition and removal of theme support in WordPress.
// add HTML5 search form support
tad_ThemeSupport::addSupport('html5', 'search-form');
// remove the support
tad_ThemeSupport::removeSupport('html5', 'search-form');