aboutsummaryrefslogtreecommitdiff
path: root/docs/en/developers
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-07-05 11:00:26 +0200
committerGravatar GitHub <noreply@github.com> 2023-07-05 11:00:26 +0200
commit1db606bc1b6cf25d9b9c4bef362acdb964ce1e8a (patch)
tree9556fec20e66270f7117850530de01f0f3c36b65 /docs/en/developers
parentebf62a4296b8007527325374608de5a7b972d598 (diff)
New extension hook entry_auto_read (#5505)
* New extension hook entry_auto_read For extensions to be notified of articles being automatically marked as read for various reasons * Documentation + entry_auto_unread
Diffstat (limited to 'docs/en/developers')
-rw-r--r--docs/en/developers/03_Backend/05_Extensions.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/en/developers/03_Backend/05_Extensions.md b/docs/en/developers/03_Backend/05_Extensions.md
index e86d73bfa..644420440 100644
--- a/docs/en/developers/03_Backend/05_Extensions.md
+++ b/docs/en/developers/03_Backend/05_Extensions.md
@@ -131,13 +131,13 @@ The `Minz_Extension` abstract class defines another set of methods that should n
You can register at the FreshRSS event system in an extensions `init()` method, to manipulate data when some of the core functions are executed.
-```html
+```php
class HelloWorldExtension extends Minz_Extension
{
- public function init() {
- $this->registerHook('entry_before_display', array($this, 'renderEntry'));
+ public function init(): void {
+ $this->registerHook('entry_before_display', [$this, 'renderEntry']);
}
- public function renderEntry($entry) {
+ public function renderEntry(FreshRSS_Entry $entry): FreshRSS_Entry {
$entry->_content('<h1>Hello World</h1>' . $entry->content());
return $entry;
}
@@ -147,6 +147,8 @@ class HelloWorldExtension extends Minz_Extension
The following events are available:
* `check_url_before_add` (`function($url) -> Url | null`): will be executed every time a URL is added. The URL itself will be passed as parameter. This way a website known to have feeds which doesn’t advertise it in the header can still be automatically supported.
+* `entry_auto_read` (`function(FreshRSS_Entry $entry, string $why): void`): Triggered when an entry is automatically marked as read. The *why* parameter supports the rules {`filter`, `upon_reception`, `same_title_in_feed`}.
+* `entry_auto_unread` (`function(FreshRSS_Entry $entry, string $why): void`): Triggered when an entry is automatically marked as unread. The *why* parameter supports the rules {`updated_article`}.
* `entry_before_display` (`function($entry) -> Entry | null`): will be executed every time an entry is rendered. The entry itself (instance of FreshRSS\_Entry) will be passed as parameter.
* `entry_before_insert` (`function($entry) -> Entry | null`): will be executed when a feed is refreshed and new entries will be imported into the database. The new entry (instance of FreshRSS\_Entry) will be passed as parameter.
* `feed_before_actualize` (`function($feed) -> Feed | null`): will be executed when a feed is updated. The feed (instance of FreshRSS\_Feed) will be passed as parameter.