{"id":24354092,"url":"https://github.com/dimitribouteille/wp-module-hook","last_synced_at":"2026-05-17T17:04:48.960Z","repository":{"id":267867196,"uuid":"779665785","full_name":"dimitriBouteille/wp-module-hook","owner":"dimitriBouteille","description":"⚡ Magic hook autoloader for WordPress.","archived":false,"fork":false,"pushed_at":"2025-08-06T17:02:19.000Z","size":39,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-06T18:36:18.944Z","etag":null,"topics":["hooks","php","wordpress","wordpress-actions","wordpress-development","wordpress-starter"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/dbout/wp-module-hook","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimitriBouteille.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-30T13:10:07.000Z","updated_at":"2025-08-06T17:03:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"47c9c06f-356b-4d63-a615-7faa5ce4b1d2","html_url":"https://github.com/dimitriBouteille/wp-module-hook","commit_stats":null,"previous_names":["dimitribouteille/wp-module-hook"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dimitriBouteille/wp-module-hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitriBouteille%2Fwp-module-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitriBouteille%2Fwp-module-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitriBouteille%2Fwp-module-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitriBouteille%2Fwp-module-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimitriBouteille","download_url":"https://codeload.github.com/dimitriBouteille/wp-module-hook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitriBouteille%2Fwp-module-hook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272262404,"owners_count":24902641,"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-26T02:00:07.904Z","response_time":60,"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":["hooks","php","wordpress","wordpress-actions","wordpress-development","wordpress-starter"],"created_at":"2025-01-18T16:59:07.552Z","updated_at":"2026-05-17T17:04:43.929Z","avatar_url":"https://github.com/dimitriBouteille.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress hook autoloader\n\n![GitHub Release](https://img.shields.io/github/v/release/dimitriBouteille/wp-module-hook) [![Packagist Downloads](https://img.shields.io/packagist/dt/dbout/wp-module-hook?color=yellow)](https://packagist.org/packages/dbout/wp-module-hook)\n\nWordPress module developed for developers who want to quickly add WordPress hooks (action \u0026 filter) without having to manually add each hook in the `function.php` file (or elsewhere).\n\n\u003e [!TIP]\n\u003e To simplify the integration of this library, we recommend using WordPress with one of the following tools: [Bedrock](https://roots.io/bedrock/), [Themosis](https://framework.themosis.com/) or [Wordplate](https://github.com/wordplate/wordplate#readme).\n\n## Documentation\n\nThis documentation only covers the specific points of this library, if you want to know more about WordPress `action` or `filter`, the easiest is to look at [the documentation of WordPress](https://developer.wordpress.org/plugins/hooks/).\n\nYou can find all the documentation in [the wiki](https://github.com/dimitriBouteille/wp-module-hook/wiki) or [here](#usage).\n\n## Installation\n\n**Requirements**\n\nThe server requirements are basically the same as for [WordPress](https://wordpress.org/about/requirements/) with the addition of a few ones :\n\n- PHP \u003e= 8.3\n- [Composer](https://getcomposer.org/)\n\n**Installation**\n\nYou can use [Composer](https://getcomposer.org/). Follow the [installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have composer installed.\n\n~~~bash\ncomposer require dbout/wp-module-hook\n~~~\n\nIn your PHP script, make sure you include the autoloader:\n\n~~~php\nrequire __DIR__ . '/vendor/autoload.php';\n~~~\n\n## Usage\n\nBefore creating your first hook, you must initialize the module. It is advisable to add this code at the beginning of the `functions.php` file of your theme or in a `mu-plugin`.\n\n```php\n$loader = new \\Dbout\\Framework\\Hook\\HookLoader(\n    directory: get_template_directory() . '/hooks',\n);\n\n$loader-\u003eregister();\n```\n\nNow you have initialized the module, you just need to create your first action in the hooks folder in your theme.\n\n```php\nuse Dbout\\Framework\\Hook\\Attributes\\Action;\nuse Dbout\\Framework\\Hook\\Attributes\\Filter;\n\nclass MyFirstHook {\n\n    #[Action(name: 'wp_dashboard_setup', priority: 999)]\n    public function setupDashboard(): void\n    {\n        // Do something   \n    }\n    \n    #[Filter(name: 'crontrol/filtered-events', acceptedArgs: 2)]\n    public function filterEvents(array $filtered, array $events): array\n    {\n        // Do something\n        return $filtered;\n    }\n}\n```\n\n## Contributing\n\n💕 🦄 We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our [contributing guidelines](CONTRIBUTING.md) to find out how to raise a pull request.\n\n## Licence\n\nLicensed under the MIT license, see [LICENSE](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitribouteille%2Fwp-module-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimitribouteille%2Fwp-module-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitribouteille%2Fwp-module-hook/lists"}