Skip to content

Commit 715b856

Browse files
committed
Add follow and unfollow stubs to WordPress adapter
Introduces follow and unfollow methods to the WordPress adapter class. These methods are currently pass-throughs, reflecting the read-only nature of core feeds, and provide a consistent interface for future extensibility.
1 parent ffe95b9 commit 715b856

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

includes/adapters/class-wordpress.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,34 @@ public function get_following( $result, $channel, $user_id ) { // phpcs:ignore G
101101
return $result;
102102
}
103103

104+
/**
105+
* Follow a URL (not supported for core feeds).
106+
*
107+
* @param array|null $result Current result or null.
108+
* @param string $channel Channel UID.
109+
* @param string $url URL to follow.
110+
* @param int $user_id The user ID.
111+
* @return array|null
112+
*/
113+
public function follow( $result, $channel, $url, $user_id ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
114+
// Read-only adapter; pass through.
115+
return $result;
116+
}
117+
118+
/**
119+
* Unfollow a URL (not supported for core feeds).
120+
*
121+
* @param bool|null $result Current result or null.
122+
* @param string $channel Channel UID.
123+
* @param string $url URL to unfollow.
124+
* @param int $user_id The user ID.
125+
* @return bool|null
126+
*/
127+
public function unfollow( $result, $channel, $url, $user_id ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
128+
// Read-only adapter; pass through.
129+
return $result;
130+
}
131+
104132
/**
105133
* Read WordPress.org news feed items.
106134
*

0 commit comments

Comments
 (0)