{"id":21602083,"url":"https://github.com/wpbp/template","last_synced_at":"2025-08-25T10:09:07.378Z","repository":{"id":57082160,"uuid":"61739247","full_name":"WPBP/template","owner":"WPBP","description":"Load template files with autosearch and support for multilanguage folder for email template","archived":false,"fork":false,"pushed_at":"2024-02-09T11:14:11.000Z","size":23,"stargazers_count":5,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-25T07:20:37.227Z","etag":null,"topics":["wordpress","wordpress-php-library"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WPBP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-06-22T17:43:42.000Z","updated_at":"2023-08-29T16:10:43.000Z","dependencies_parsed_at":"2024-03-02T07:46:20.413Z","dependency_job_id":null,"html_url":"https://github.com/WPBP/template","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.06666666666666665,"last_synced_commit":"460d03f122e25a96256cac990593517896662049"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/WPBP/template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WPBP%2Ftemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WPBP%2Ftemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WPBP%2Ftemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WPBP%2Ftemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WPBP","download_url":"https://codeload.github.com/WPBP/template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WPBP%2Ftemplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272045233,"owners_count":24864021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress","wordpress-php-library"],"created_at":"2024-11-24T19:11:58.034Z","updated_at":"2025-08-25T10:09:07.353Z","avatar_url":"https://github.com/WPBP.png","language":"PHP","readme":"# Template\n[![License](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)\n![Downloads](https://img.shields.io/packagist/dt/wpbp/template.svg) \n\nTemplating system in WordPress (woocommerce like) also for email with l10n support.  \n\n* Your plugin will be able to provide a `templates` folder that will be loaded by the plugin\n* If a theme has a folder with the same slug name of the plugin will look if the file exist there\n\n## Install\n\n`composer require wpbp/language:1.0.1`\n\n[composer-php52](https://github.com/composer-php52/composer-php52) supported.\n\n## Example\n\n```php\n// This is like the woocommerce function\nfunction load_content_demo( $original_template ) {\n        if ( is_singular( 'demo' ) \u0026\u0026 in_the_loop() ) {\n            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\n        } else {\n            return $original_template;\n        }\n}\nadd_filter( 'template_include', 'load_content_demo' );\n\n// This is an extended version that search for folder with names based on locales like it_IT\n$get_template_email = wpbp_get_template_part( 'plugin-name-folder' , 'header', 'prefix' );\n```\n\nIn this case will look for a `content-demo.php` file.\n\n`wpbp_get_template_part` is the same of https://developer.wordpress.org/reference/hooks/get_template_part/ this filter, the difference is that this one is executed by this library\n\n`wpbp_get_email_template` is a function that looks for folder like `en_US` with file's extension `.tpl`.\n\nThe code is very easy and in case of doubts you can check [here](https://github.com/WPBP/template/blob/master/template.php).\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpbp%2Ftemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpbp%2Ftemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpbp%2Ftemplate/lists"}