[buddypress-trac] [BuddyPress Trac] #7918: Filter for bp_nouveau_get_filter_options to change dropdown options

buddypress-trac noreply at wordpress.org
Fri Jul 27 13:47:14 UTC 2018


#7918: Filter for bp_nouveau_get_filter_options to change dropdown options
--------------------------+---------------------
 Reporter:  wbcomdesigns  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.2.0
Component:  Templates     |     Version:  3.0.0
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+---------------------

Comment (by imath):

 Hi @r-a-y & @wbcomdesigns

 Thanks for the report and the work on this ticket. I think
 [https://buddypress.trac.wordpress.org/raw-
 attachment/ticket/7918/7918.01.patch 7918.01.patch] is a good first step.
 I also think, adding a new filter to edit the default selected value is a
 possible way, but as the selected value is set using JavaScript (see
 buddypress.js or buddypress-nouveau.js), I'd probably do it using
 JavaScript to avoid parsing the output.

 In legacy, this can be done by setting the `$.cookie( 'bp-activity-filter'
 )` cookie with the default value if it's not set yet and in Nouveau by
 setting the `bp-activity` session storage filter property with the default
 value. Here's an example of how you can achieve it :

 https://gist.github.com/imath/cac9a342fd38f1542182cb2e43a303ab

 I would recommend to work on a Core JavaScript file to store some default
 values just like this one in a future release so that it's easier for
 plugin developers to get/set informations about scope, filter, current
 action, current component etc.. Just like the `buddypress()` or global
 `$bp` does.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7918#comment:6>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list