{"id":26793237,"url":"https://github.com/beapi/bea-silo","last_synced_at":"2026-05-01T15:34:24.714Z","repository":{"id":30380648,"uuid":"123599831","full_name":"BeAPI/bea-silo","owner":"BeAPI","description":"Dev oriented plugin to add silo feature (IN DEVELOPMENT)","archived":false,"fork":false,"pushed_at":"2024-06-03T13:58:14.000Z","size":79,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-04-13T03:33:17.201Z","etag":null,"topics":["silo","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://beapi.fr","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/BeAPI.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}},"created_at":"2018-03-02T16:01:30.000Z","updated_at":"2024-06-03T13:58:09.000Z","dependencies_parsed_at":"2024-06-03T09:39:43.284Z","dependency_job_id":"3185bf79-6813-4bf3-a970-7c8d2107c8ee","html_url":"https://github.com/BeAPI/bea-silo","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/BeAPI/bea-silo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeAPI%2Fbea-silo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeAPI%2Fbea-silo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeAPI%2Fbea-silo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeAPI%2Fbea-silo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BeAPI","download_url":"https://codeload.github.com/BeAPI/bea-silo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeAPI%2Fbea-silo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32503197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["silo","wordpress","wordpress-plugin"],"created_at":"2025-03-29T16:19:34.322Z","updated_at":"2026-05-01T15:34:24.696Z","avatar_url":"https://github.com/BeAPI.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BEA - Silo (IN DEVELOPMENT)\n\nDev oriented plugin to add silo feature :\n\n* It will use `wp_localize_script` to localize (javascript), depending on some conditions, terms from wanted taxonomies against wanted post type.\n* You can overwrite default term's object to add/remove some values.\n* By default a custom [REST Api](https://bitbucket.org/beapi/bea-silo#markdown-header-rest-api) route is created to ease matching post type and taxonomy silo content.\n* These matching content will be displayed using a _s template located by default into `silo/templates/` folder. But they can be overwrited into theme or child-theme.\n* The silo is displayed with an action from the `silo/blocks/` folder. But it can be overwrited into theme or child-theme.\n* By default, plugin generate a default silo view into `silo-{taxonomy_name}.php` template.\n\n# Installation\n\n## WordPress\n\n* Download and install using the built-in WordPress plugin installer.\n* Site Activate in the \"Plugins\" area of the admin.\n* Optionally drop the entire `bea-silo` directory into `plugins`.\n* Add into your theme's functions.php file or through a plugin, the expected [Steps](https://bitbucket.org/beapi/bea-silo#markdown-header-steps).\n\n## Composer\n\n* Add repository source : { \"type\": \"vcs\", \"url\": \"https://github.com/BeAPI/bea-silo\" }.\n* Include \"bea/bea-silo\": \"dev-master\" in your composer file for last master's commits or a tag released.\n\n# Steps to use\n\n## Special warning\nIf using the default taxonomy's silo view. Watch out about SEO with duplicate content.\n\n## Register post type support\n\nWhile waiting [ticket/40413](https://core.trac.wordpress.org/ticket/40413) merge into core, add post type support like this :\n\n```\n\u003c?php add_post_type_support( {post_type}, 'silo', {taxonomy_1}, {taxonomy_2}, {etc} );\n```\nAfter merge, you could do :\n```\n\u003c?php register_post_type( {post_type}, [ 'supports' =\u003e [ 'silo' =\u003e [ {taxonomy_1}, {taxonomy_2}, {etc} ] ] ] );\n```\n\n## Define localize conditions \n\n### Custom localization\n\nOn the hook `bea\\silo\\localize_terms` you specify where to localize your terms taxonomy for a post type.\n```\n\u003c?php\n/**\n * Check custom conditions to check if to work on current taxonomy against current post type.\n *\n * @author Maxime CULEA\n *\n * @since 1.0.0\n *\n * @param bool $localize_taxonomy Whatever to localize terms against given taxonomy.\n * @param string $taxonomy The taxonomy name as context.\n * @param string $post_type The Post Type name as context.\n */\napply_filters( 'bea\\silo\\localize_terms', false, $taxonomy, $post_type )\n```\n\n#### Example\n\n```\n\u003c?php\n/**\n * Depending on context, add the thematic silo\n *\n * @author Maxime CULEA\n *\n * @param $hide_or_display\n * @param $taxonomy\n * @param $post_type\n *\n * @return bool\n */\nfunction bea_where_to_localize_thematic( $hide_or_display, $taxonomy, $post_type ) {\n    return BEA_TAX_THEMATIC_NAME === $taxonomy \u0026\u0026 BEA_CPT_POST_NAME === $post_type \u0026\u0026 is_home() ? true : $hide_or_display;\n}\nadd_filter( 'bea\\silo\\localize_terms', 'bea_where_to_localize_thematic', 10, 3 );\n```\n\n### Default localization\n\nBy default the plugin is generating a default template view for your silos located on : `silo-{taxonomy_name}.php`.\nYou Can overwrite this default template by playing withe the following filter : \n\n```\n\u003c?php\n/**\n * Change the default taxonomy silo slug\n *\n * @author Maxime CULEA\n *\n * @since 1.1.0\n *\n * @param string $slug The taxonomy's default silo slug.\n * @param string $$taxonomy The taxonomy name working on.\n */\nreturn apply_filters( 'BEA\\Helpers\\taxonomy_silo_slug', sprintf( 'silo-%s', $taxonomy ), $taxonomy );\n```\n\nIt is most useful when displaying a silo on homepage - you will be able to come back into deep silo chosen hierarchy. In this case your homepage template and the default one could be the same. So watch out about duplicate content.\n\n## Customize queried terms for the taxonomy\n\nOn the hook `bea\\silo\\term_query\\args` you filter the args in order to retrieve the taxonomy's terms. By default `$args` has only `'hide_empty' =\u003e false`.\n```\n\u003c?php\n/**\n * Filter the arguments to retrieve given taxonomy's terms.\n *\n * @author Maxime CULEA\n *\n * @since 1.0.0\n *\n * @param array $args Arguments for the WP_Term_Query or the get_terms();\n * @param string $taxonomy The taxonomy name as context.\n */\n$args = apply_filters( 'bea\\silo\\term_query\\args', $args, $taxonomy );\n```\n\n## Customize returned localized terms\n\nOn the hook `bea\\silo\\term_object` you filter the given array to add or remove some values from the current term for the given taxonomy and post type.\n```\n\u003c?php\n/**\n * Filter term object to add / delete some attributes.\n *\n * @author Maxime CULEA\n *\n * @since 1.0.0\n *\n * @param array $new_item The formatted term object for response.\n * @param \\WP_Term $_term The term object.\n * @param string $taxonomy The taxonomy name as context.\n */\nreturn apply_filters( 'bea\\silo\\term_object', $new_item, $_term, $_term-\u003etaxonomy );\n```\n\n### Example\n\n```\n\u003c?php\n/**\n * Add the term's color\n *\n * @author Maxime CULEA\n *\n * @param $new_item\n * @param \\WP_Term $_term\n * @param $_taxonomy\n *\n * @return mixed\n */\nfunction bea_silo_add_color( $new_item, \\WP_Term $_term, $_taxonomy ) {\n    if ( 0 == $new_item['level'] ) {\n        $new_item['color'] = sprintf( '#%s', get_field( 'color', $_term, true ) );\n    }\n\n    return $new_item;\n}\nadd_filter( 'bea\\silo\\term_object', 'bea_silo_add_color', 10, 3 );\n```\n\n## Display !\n\nOn the action `bea\\silo\\display` you display the wanted silo for the given post types and the taxonomy.\n```\n\u003c?php\n/**\n * Action in purpose to display silo's underscores and html templates depending on the given post types and taxonomy.\n * Underscore templates :\n * - button\n * - results\n * - no results\n *\n * @author Maxime CULEA\n *\n * @since 1.0.0\n *\n * @param array $post_types : array of wanted post type names\n * @param string $taxonomy : the taxonomy name\n */\ndo_action( 'bea\\silo\\display', [ {post_type_1}, {post_type_2} ], [ {taxonomy} ] );\n```\n\nWith the matching args, custom templates (_s) and views (html) can be made  and they are loaded in the below order :\n\n1. Child theme \n2. Theme\n3. Silo plugin\n\n* _S templates are conditionally loaded :\n    1. silo/templates/{taxonomy}-{template}-tpl.js (1 \u0026 2)\n    2. silo/templates/{template}-tpl.js (1 \u0026 2)\n    3. templates/{template}-tpl.js (3)\n* View :\n    1. silo/blocks/{taxonomy}-silo.php (1 \u0026 2)\n    2. silo/blocks/silo.php (1 \u0026 2)\n    3. blocks/silo.php (3)\n\n# REST Api\n\nA REST Api route is automaclly registered to get contents depending on post types and a taxonomy term.\n\nREST Api route looks like `{ndd}/wp-json/bea/silo?post_types[0]=post\u0026term_id=4`, where :\n\n* post_types is an array of post type names to retrieve the content for\n* a silotable taxonomy's term id for the given post types to retrieve the contents for\n\n# Changelog\n\n## 1.1.7 - 31 May 2024\n* Fix compatibility bug on REST_REQUEST\n\n## 1.1.6 - 12 May 2022\n* Handle empty taxonomy silo case\n\n## 1.1.5 - 24 Janv 2019\n* Add new filter on args for register_rest_route in controller\n\n## 1.1.4 - 12 Nov 2018\n* Add errors on function get_contents_check\n\n## 1.1.3 - 11 Mar 2018\n* Fix items response with childrens\n\n## 1.1.2 - 06 Mar 2018\n* Update items response with childrens\n* Load JS/Script Data on wp_enqueue_script hook\n* Add composer json file\n\n## 1.1.1 - 01 Jun 2017\n* Add some filters.\n\n## 1.1.0 - 29 Mai 2017\n* Handle a default silo slug and view for a taxonomy.\n\n## 1.0.2 - 29 Mai 2017\n* For hierarchical taxonomies, construct full term link with ancestors.\n\n## 1.0.1 - 13 Apr 2017\n* Refactoring.\n* Fix REST Api class.\n* Add display \"Blocks\" class for _s and view display.\n\n## 1.0.0 - 11 Apr 2017\n* Refactoring \u0026 reformatting.\n* Update readme with usage \u0026 example.\n* Add plugin's .pot.\n* Init with boilerplate 2.1.6.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeapi%2Fbea-silo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeapi%2Fbea-silo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeapi%2Fbea-silo/lists"}