Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/11/2014 03:13:23 PM (5 years ago)
Author:
r-a-y
Message:

Add ability to query activity items by date.

This commit:

  • Introduces the BP_Date_Query class. This class extends WP_Date_Query, which will enable us to easily add support to query various BuddyPress items by date.
  • Adds a new 'date_query' parameter to BP_Activity_Activity::get(). This parameter utilizes the new BP_Date_Query class and is an example of how to use the class in BuddyPress. (Will add support for the Groups component in a later commit.)
  • Adds unit tests.

Due to the dependency on the WP_Date_Query class, this functionality is
only available in WordPress 3.7+.

Fixes #5803.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-template.php

    r8784 r8787  
    179179            'search_terms'      => false,
    180180            'meta_query'        => false,
     181            'date_query'        => false,
    181182            'display_comments'  => 'threaded',
    182183            'show_hidden'       => false,
     
    221222                'search_terms'      => $search_terms,
    222223                'meta_query'        => $meta_query,
     224                'date_query'        => $date_query,
    223225                'filter'            => $filter,
    224226                'show_hidden'       => $show_hidden,
     
    568570
    569571        'meta_query'        => false,        // filter on activity meta. See WP_Meta_Query for format
     572        'date_query'        => false,        // filter by date. See first parameter of WP_Date_Query for format
    570573
    571574        // Searching
     
    681684        'search_terms'      => $search_terms,
    682685        'meta_query'        => $meta_query,
     686        'date_query'        => $date_query,
    683687        'display_comments'  => $display_comments,
    684688        'show_hidden'       => $show_hidden,
Note: See TracChangeset for help on using the changeset viewer.