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

feat(shortcode): Add ability to NOT include forms to the form grid by id #3206

Closed
samsmith89 opened this issue May 10, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@samsmith89
Copy link

commented May 10, 2018

User Story

As a site admin, I want to be able to NOT add forms to the form grid by ID. This would be great when I'm using some sort of integration for users to add forms for crowdfunding. I can then just exclude the few forms I don't want in the grid as opposed to having to add each one I do.

Acceptance Criteria

  • I can add the exclude parameter to prevent specific forms from appearing in the form grid.
  • By default this parameter is set to an empty string ''.
  • An issue has been created in https://github.com/wordimpress/give-docs so the support team can document the new attribute.

Current Behavior

I currently have to add each one that is made if I don't want to display all of them.

Expected Behavior

I expect to be able to be able to exclude forms from the grid based on id.

Example

[give_form_grid exclude="1,5"] - This would display a form grid that displays every form except forms with an id of 1 or 5.

Possible Solution

  • Add an exclude parameter to [give_form_grid] shortcode.
  • Map the exclude parameter to the post__not_in argument of the WP_Query that is used in the shortcode.

Related

https://secure.helpscout.net/conversation/577419018/18152/

@kevinwhoffman

This comment has been minimized.

Copy link
Member

commented Jun 29, 2018

@Sidsector9 I have updated the acceptance criteria and possible solution in the original comment. Please move forward with adding this attribute so that forms can be excluded by id.

Also be sure to create the docs issue when this is complete.

@Sidsector9

This comment has been minimized.

Copy link
Member

commented Jun 29, 2018

@kevinwhoffman If we are looking forward to make Give VIP compatible, then we shouldn't use post__not_in since the cache hits will be lower. Instead we should fetch posts and skip whatever needs to be excluded.

Please refer this - https://vip.wordpress.com/documentation/performance-improvements-by-removing-usage-of-post__not_in/

CC: @ravinderk @DevinWalker

@kevinwhoffman

This comment has been minimized.

Copy link
Member

commented Jun 29, 2018

@Sidsector9 It seems like using in_array() instead of post__not_in would throw off pagination. For example, if I have 12 posts per page in the form grid and 2 of those IDs are excluded, then I'm only going to see 10 forms on that page, correct?

The difference is that post__not_in ensures only the desired posts are returned, while the in_array() approach returns everything and selectively skips posts.

With that said, we should make a note in documentation to not overuse this feature and instead use categories for selectively grouping forms in the grid.

DevinWalker added a commit that referenced this issue Jul 3, 2018

Merge pull request #3427 from WordImpress/issue/3206
feat(shortcode): Add ability to NOT include forms to the form grid by id #3206

@DevinWalker DevinWalker closed this Jul 3, 2018

@raftaar1191 raftaar1191 referenced this issue Jul 12, 2018

Closed

qa(give): ensure quality of Give 2.2 #3467

33 of 33 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.