Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add force param #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Parser/ItemsParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ public function __construct($content, $feed)

$maxImages = $this->getParam('count');
$reverse = $this->getParam('reverse');

$force = $this->getParam('force');
$item_i = 0;
$items = $feed->getFeed()->get_items();
$feed = $feed->getFeed();
if ($force) {
$feed->force_feed(true);
$feed->enable_order_by_date(false);

}
$items = $feed->get_items();
if ($reverse == 1) {
$items = array_reverse($items);
}
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ Returns: description of the feed

### The following tags can be used in the {feeditems} block:

Optional param:
Optional params:
- reverse {feeditems count="3" reverse="1"} - returns posts in reversed view

- force {feeditems count="3" force="1"} - returns posts in order from rss, not by date

#### {feeditem:title}
Returns: title of the post

Expand Down