Download the PHP package lin3s/wp-foundation without Composer
On this page you can find all versions of the php package lin3s/wp-foundation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lin3s/wp-foundation
More information about lin3s/wp-foundation
Files in lin3s/wp-foundation
Package wp-foundation
Short Description Helper classes for building WordPress theme in the LIN3S way
License MIT
Informations about the package wp-foundation
WordPress Foundation
Helper classes for building WordPress theme in the LIN3S way
Why?
After implementing several WordPress themes, we built what we think can be considered as best practices building this kind of projects in a clean, consistent and fast way: thus was born LIN3S's WordPress Standard Edition. We are really happy with it, but there are some tasks that are very repetitive and tedious, furthermore each developer usually implements in a different way so, with this library we try to avoid these kind of troubles. At this moment, WPFoundation only contains a set of interfaces and abstract classes (in the future who knows :)) to force all developers to follow the same way becoming our code more consistent.
Installation
The recommended and the most suitable way to install is through Composer. Be sure that the tool is installed in your system and execute the following command:
Usage examples
The following code snippets are representative code samples of how can it use this library:
- Ajax
- Ajax
- Configuration
- ACF
- Assets
- Mailer
- Menus
- Theme
- Translations
- PostTypes
- PostType
- Fields
- RewriteRules
- Twig
- TagManagerTwig
- TranslationTwig
- Widgets
- Widget
- Widget Areas
Ajax
ACF
ACF configuration class, this class is responsible for all the logic about this WordPress plugin. A this moment this API only has one method that allows to have seamlessly multiple WYSWYG configuration for this type field used by ACF.
Assets
Mailer
Mailer
class configures the way that emails are sent using wp_mail()
. You should configure the mailer parameters
editing the WordPress config file. Default parameters are given for the localhost smtp delivery.
You can define your own custom mailer that implements MailInterface
and uses wp_mail()
configuration selected
creating an instance of one of the two strategies above.
MailerInterface
is deprecated and will be removed in v2.0.0. Use wp_mail() directly to send the emails
Menus
Theme
Translations
PostType
Declaring a post type is as easy as creating a new instance of PostType
.
To add custom fields to a custom post type just create a Fields
instance:
Fields
RewriteRules
TagManagerTwig
After instantiate the the TagManagerTwig
in your theme, you can just call as following:
TranslationTwig
After instantiate the the TranslationTwig
in your theme, you can just call as following: