PHPackages                             wpbp/template - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. wpbp/template

ActiveLibrary[Templating &amp; Views](/categories/templating)

wpbp/template
=============

Load template files with autosearch and support for multilanguage folder for email template

1.0.4(2y ago)625.0k↑33.3%5GPL-3.0PHP

Since Jun 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/WPBP/template)[ Packagist](https://packagist.org/packages/wpbp/template)[ Docs](https://github.com/WPBP/Template)[ RSS](/packages/wpbp-template/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

Template
========

[](#template)

[![License](https://camo.githubusercontent.com/1b0c7e4911720d0444c16a1ffd145a039f14a1a7305362ab51184f757a4dd6bc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c25323076332d626c75652e737667)](http://www.gnu.org/licenses/gpl-3.0)[![Downloads](https://camo.githubusercontent.com/103705e06be6335928fb797e7817bbed0a7297d6ed5fee5fad6ba19bec801b27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f777062702f74656d706c6174652e737667)](https://camo.githubusercontent.com/103705e06be6335928fb797e7817bbed0a7297d6ed5fee5fad6ba19bec801b27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f777062702f74656d706c6174652e737667)

Templating system in WordPress (woocommerce like) also for email with l10n support.

- Your plugin will be able to provide a `templates` folder that will be loaded by the plugin
- If a theme has a folder with the same slug name of the plugin will look if the file exist there

Install
-------

[](#install)

`composer require wpbp/language:1.0.1`

[composer-php52](https://github.com/composer-php52/composer-php52) supported.

Example
-------

[](#example)

```
// This is like the woocommerce function
function load_content_demo( $original_template ) {
        if ( is_singular( 'demo' ) && in_the_loop() ) {
            return wpbp_get_template_part( 'plugin-name-folder', 'content', 'demo', false, array() ); // The last parameter is for arguments to pass to the template but is not mandatory
        } else {
            return $original_template;
        }
}
add_filter( 'template_include', 'load_content_demo' );

// This is an extended version that search for folder with names based on locales like it_IT
$get_template_email = wpbp_get_template_part( 'plugin-name-folder' , 'header', 'prefix' );
```

In this case will look for a `content-demo.php` file.

`wpbp_get_template_part` is the same of [https://developer.wordpress.org/reference/hooks/get\_template\_part/](https://developer.wordpress.org/reference/hooks/get_template_part/) this filter, the difference is that this one is executed by this library

`wpbp_get_email_template` is a function that looks for folder like `en_US` with file's extension `.tpl`.

The code is very easy and in case of doubts you can check [here](https://github.com/WPBP/template/blob/master/template.php).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~656 days

Total

5

Last Release

993d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/db79d5416d942e5fd9415b136feefd2da7929cc39853b4c30bafff4ceb8ef219?d=identicon)[Mte90](/maintainers/Mte90)

---

Top Contributors

[![Mte90](https://avatars.githubusercontent.com/u/403283?v=4)](https://github.com/Mte90 "Mte90 (15 commits)")[![yaroslav-borodii](https://avatars.githubusercontent.com/u/64497493?v=4)](https://github.com/yaroslav-borodii "yaroslav-borodii (1 commits)")

---

Tags

wordpresswordpress-php-librarywordpressemailtemplate

### Embed Badge

![Health badge](/badges/wpbp-template/health.svg)

```
[![Health](https://phpackages.com/badges/wpbp-template/health.svg)](https://phpackages.com/packages/wpbp-template)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
