Skip to content

Commit 4fb9ea4

Browse files
committed
Refactor RSS widgets loop for clarity
Assigns the result of get_rss_widgets() to a variable before iterating, improving readability and potential reusability.
1 parent 76bcf1f commit 4fb9ea4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

includes/adapters/class-wordpress.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function get_channels( $channels, $user_id ) { // phpcs:ignore Generic.Co
5555
'name' => \__( 'Planet WordPress', 'microsub' ),
5656
);
5757

58-
foreach ( $this->get_rss_widgets() as $widget ) {
58+
$rss_widgets = $this->get_rss_widgets();
59+
foreach ( $rss_widgets as $widget ) {
5960
$channels[] = array(
6061
'uid' => 'wp-rss-' . $widget['id'],
6162
'name' => $widget['name'],

0 commit comments

Comments
 (0)