Closed nickcernis closed 6 years ago
I was wondering why posts_per_page wasn't added, I have many FAQs I want to add but it stopped at the posts_per_page option in reading settings. This was a bummer. For the time being, I just changed the plugin code and will make a note not to upgrade yet.
@carasmo @nickcernis So am I correct in assuming the only use-case for a FAQ count limit would be in the event of using a shortcode variation like [gs_faq cat="35"]
or [gs_faq]
?
@cjkoepke That's one good use-case, yes. Users may want to specify a limit for the widget, or override the limit with a filter in their theme.
So what's the point of limiting though, unless there's pagination?
You can also achieve a limit if you comma-delimit a list of IDs — but I can see adding a simple param like limit="10"
being an easier approach.
So what's the point of limiting though, unless there's pagination?
https://wordpress.org/support/topic/number-of-items-displayed/
Users would like to easily allow more than the default number of FAQs to be displayed without editing the global Reading Settings, which affects all post types.
So, when the option is added limit= I could add -1 to get all of them. The display posts shortcode has posts_per_page no pagination. Tough tookies -- he won't add it (make your own loop is what he says and I agree). I use it with an FAQ cpt want to show all from a specific term or all of them and no pagination.
@nickcernis Ah, okay that forum topic explains it a bit better. So how about this for scope:
Sounds good, @cjkoepke!
@nickcernis This can be reviewed, but I've added limits to both the shortcode and widget. Defaults accurately to global setting.
Looks good! I confirmed that:
Hey yall, I just posted on the WP forum but realized it's easier here. Just adding my 2-cents that I don't think this (https://github.com/copyblogger/genesis-simple-faq/issues/29#issuecomment-327260061) is the best flow. I would expected the default [gs_faq]
shortcode to show all FAQs. If a limit
param is used, then it uses that number. I think it would rarely ever make sense to follow posts_per_page global option. Most of the time people will want to show all, or all in a cat, or specific faqs by ID. IMHO.
I agree, @JiveDig – it makes sense to have no limit as the default. Pull request sent.
Tested with 100 entries generated via WP-CLI:
I took confirmed off of this since the pull request will need to get merged to develop, then confirmed and merged to master. This way the current pull request from develop to master doesn't assume this is resolved and get released as such.
cc @nathanrice
Noting the PR functionality was confirmed.
As requested in the plugin forum, users would like a way to control the number of FAQs displayed.
Suggest one or more of: