Skip to content

Commit 336d692

Browse files
committed
Defer plugin setup to the plugins_loaded hook
1 parent 6853b01 commit 336d692

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/).
44

5+
## [1.8.0] - 2026-04-22
6+
7+
### Changed
8+
9+
- Defer plugin setup to the `plugins_loaded` hook.
10+
511
## [1.7.0] - 2026-03-04
612

713
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To include this plugin as a dependency in your Composer-managed WordPress projec
3333
composer require s3rgiosan/littlefoot
3434
```
3535

36-
2. Run `composer install` to install the plugin.
36+
2. Run `composer install`.
3737
3. Activate the plugin from your WordPress admin area or using WP-CLI.
3838

3939
## Usage

plugin.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Plugin URI: https://github.com/s3rgiosan/littlefoot
66
* Requires at least: 6.7
77
* Requires PHP: 7.4
8-
* Version: 1.7.0
8+
* Version: 1.8.0
99
* Author: Sérgio Santos
1010
* Author URI: https://s3rgiosan.dev/?utm_source=wp-plugins&utm_medium=littlefoot&utm_campaign=author-uri
1111
* License: MIT
@@ -37,4 +37,13 @@
3737
'littlefoot'
3838
);
3939

40-
( Plugin::get_instance() )->setup();
40+
/**
41+
* Load the plugin.
42+
*/
43+
add_action(
44+
'plugins_loaded',
45+
function () {
46+
$plugin = Plugin::get_instance();
47+
$plugin->setup();
48+
}
49+
);

0 commit comments

Comments
 (0)