{"id":34638695,"url":"https://github.com/generoi/wp-timber-extended","last_synced_at":"2025-12-24T17:12:46.757Z","repository":{"id":147858807,"uuid":"75331653","full_name":"generoi/wp-timber-extended","owner":"generoi","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-21T14:11:39.000Z","size":141,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-21T16:33:04.180Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/generoi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-12-01T20:50:37.000Z","updated_at":"2025-07-21T14:11:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"f56d192e-b325-4f00-bc81-bd37c4a40a1c","html_url":"https://github.com/generoi/wp-timber-extended","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/generoi/wp-timber-extended","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-timber-extended","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-timber-extended/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-timber-extended/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-timber-extended/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generoi","download_url":"https://codeload.github.com/generoi/wp-timber-extended/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-timber-extended/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28005414,"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-12-24T02:00:07.193Z","response_time":83,"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":[],"created_at":"2025-12-24T17:12:45.515Z","updated_at":"2025-12-24T17:12:46.751Z","avatar_url":"https://github.com/generoi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wp-timber-extended\n\n\u003e A wordpress plugin extending [Timber](https://github.com/timber/timber/) with various features such as automatic template loading.\n\n## Features\n\n- Woocommerce support for partial templates\n- Tailor support for partial templates\n- Widgets rendered through twig templates\n- Inherit password protection from parent pages.\n- BEM classes for Timber Menus.\n- Language Menu for WPML and PLL.\n- A debug bar panel for inspecting template suggestions.\n- Basic additions to all timber contexts (theme mods, site icon, etc).\n\n## Theme features\n\nYou need to activate the features in your theme using `add_theme_support`\n\n### Automatic Timber templating system\n\n\u003e Replace the core PHP templating system with Timber and provide additional template suggestions.\n\nTo use this feature, clarify that your theme supports it with\n`add_theme_support` and then create an `index.twig` file in the `TEMPLATEPATH` location, or a location specifically added to `Timber::$dirname` in your theme.\n\n```php\nadd_theme_support('timber-extended-templates', [\n  // Use double dashes as the template variation separator.\n  'bem_templates',\n  // Use timber to render widgets.\n  'widget',\n  // Use timber to WooCommerce templates.\n  'woocommerce',\n  // Use timber to Tailor templates.\n  'tailor',\n]);\n```\n\nRegular PHP files will still be supported but twig versions will take precedence if available. You can inspect the template suggestions for each page if you're using the _Debug_ plugin. If the page is a [`tailored`](https://github.com/andrew-worsfold/tailor) page, there will also exist a `\u003ctype\u003e-tailor.twig` suggestion.\n\nDepending on the type of page is being rendered, various global context variables will be available. Eg. category templates will have both `term` and `posts` available, while single posts have only a `post` object. In addition to these there's also `template_file` and `template_type` available.\n\n### Password inheritance from parent posts\n\nIf a post parent is password protected, so are it's children.\n\n```php\nadd_theme_support('timber-extended-password-inheritance');\n```\n\n### Additional twig extensions\n\nAdd additional twig functions and filters.\n\n```php\nadd_theme_support('timber-extended-twig-extensions', [\n  // Add some core functions and filters to twig.\n  'core',\n  // Add some contrib functions and filters to twig.\n  'contrib',\n  // Add some functional programming helpers to twig.\n  'functional'\n]);\n```\n\n## Bundled Timber classes\n\n- `TimberExtended\\Post`: Extended Timber\\Post\n- `TimberExtended\\Term`: Extended Timber\\Term\n- `TimberExtended\\Image`: Extended Timber\\Image\n- `TimberExtended\\User`: Extended Timber\\User\n- `TimberExtended\\Widget`: Widget object for ACFW or regular core widgets.\n- `TimberExtended\\Menu`: Extended Timber\\Menu adding BEM classes to menu items.\n- `TimberExtended\\MenuItem`: Extended Timber\\MenuItem adding BEM classes to menu item as well as their links.\n- `TimberExtended\\LanugageMenu`: TimberExtended\\Menu-like dummy class which contains the site languages as it's items (WPML/PLL support).\n\n## Filters API\n\n```php\n// Modify the template suggestions\nadd_filter('timber_extended/templates/suggestions', function ($templates) {\n  return $templates;\n});\n\n// Disable Twig suggestions.\nadd_filter('timber_extended/templates/twig', '__return_false');\n\n// Set custom timber subclasses.\nadd_filter('timber_extended/class', function ($class_name, $type, $object = null) {\n  switch ($type) {\n    case 'post': return __NAMESPACE__ . '\\\\Controller\\\\Post';\n    case 'term': return __NAMESPACE__ . '\\\\Controller\\\\Term';\n    case 'user': return __NAMESPACE__ . '\\\\Controller\\\\User';\n    case 'image': return __NAMESPACE__ . '\\\\Controller\\\\Image';\n    case 'widget': return __NAMESPACE__ . '\\\\Controller\\\\Widget';\n  }\n  return $class_name;\n}, 10, 3);\n\n// Set custom Timber subclasses.\nadd_filter('timber_extended/{user,widget,image,post,term,menu,menuitem}/class', function ($class_name, $object = null) {\n  return __NAMESPACE__ . '\\\\User';\n});\n\nadd_filter('timber_extended/image/init'', function ($image) {\n  $image-\u003efile_loc = '';\n  return $image;\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneroi%2Fwp-timber-extended","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneroi%2Fwp-timber-extended","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneroi%2Fwp-timber-extended/lists"}