INN / umbrella-citylimits

CityLimits.org Site
https://citylimits.org
GNU General Public License v2.0
0 stars 2 forks source link

Special projects "featured content area" widget #100

Closed joshdarby closed 4 years ago

joshdarby commented 4 years ago

Changes

This pull request makes the following changes:

Desktop: screencapture-citylimits-test-series-election-watch-2018-2019-11-08-14_03_55

Mobile: screencapture-citylimits-test-series-election-watch-2018-2019-11-08-14_04_34

Why

For #73

Testing/Questions

Features that this PR affects:

Questions that need to be answered before merging:

Steps to test this PR:

  1. Find a series with more than ( 7 (7 series widget) + 8 (this widget) = ) 15 posts
  2. Add the new City Limits Seven Series Posts widget to the landing page and set it to avoid duplicates
  3. Add the City Limits Special Projects Featured Content widget to a landing page and make sure it's set to avoid duplicate posts
  4. Make sure both widgets do not display duplicate posts
  5. Find any weird edge cases
benlk commented 4 years ago

Should we name it something like City Limits Special Projects Series Archive? Sounds good to me.

I had to redeclare largo_load_more_posts_choose_partial since the filter largo_lmp_template_partial doesn't pass the $query_vars for me to be able to check if the widget is calling LMP. Is there an easier way to do this besides redeclaring this function?

Aren't they passed to the filter as $post_query->query_vars?

https://github.com/INN/largo/blob/512da701664b329f2f92244bbe54880a6e146431/inc/ajax-functions.php#L157

Make sure both widgets do not display duplicate posts

If both widgets have checked the box to avoid duplicate posts, then it works.

joshdarby commented 4 years ago

Er, yep. I read that wrong because

* When building your own filter, you must set the fourth parameter of add_filter to 2:
//   *
//   *     function your_filter_name($partial, $post_type) {

post_type got me mixed up. I'll update to use the filter instead of redeclaring the function.