[wp-trac] [WordPress Trac] #42254: Duplicate news entries in Events & News dashboard widget
WordPress Trac
noreply at wordpress.org
Wed Nov 1 20:21:45 UTC 2017
#42254: Duplicate news entries in Events & News dashboard widget
-------------------------------------------------+-------------------------
Reporter: iandunn | Owner:
Type: defect (bug) | Status: new
Priority: low | Milestone: Future
Component: Administration | Release
Severity: minor | Version: 4.8
Keywords: good-first-bug has-patch has-unit- | Resolution:
tests | Focuses:
-------------------------------------------------+-------------------------
Comment (by birgire):
Thanks for the feedback @Iceable
Good catch, regarding the {{{$rss_entries->get_error_message()}}}.
Regarding the offset, I wrongly recalled from memory, that both items
counts were filterable, but I checked again and it's only true for the
second feed, via the {{{dashboard_secondary_items}}} filter. The first one
is fixed as 1.
So I think we could just use:
{{{
$args['items'] = $args['items'] + 1;
}}}
as you mentioned ... but if both were filterable, then we could have used
e.g.:
{{{
min( feed_1_items_count, feed_2_items_count )
}}}
instead of the compromise of {{{$args['items'] = $args['items'] + 5;}}}
The WordPress Code Standard via phpcs suggested using {{{lower-case.php}}}
kind of file name
and I noticed the same for files in e.g.
{{{tests/phpunit/tests/customize/}}}. I will have to look further into
that.
Regarding the multi-feed feature, there are also some
[http://simplepie.org/wiki/faq/typical_multifeed_gotchas gotchas] and we
also don't want to merge the items.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42254#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list