buddypress / next-template-packs

is this the next BuddyPress template pack?
35 stars 9 forks source link

Port BP core Notifications functions to Nouveau #135

Closed hnla closed 7 years ago

hnla commented 7 years ago

In core bp-*-screens.php files we maintain the front end markup for the user settings 'notifications' tables markup ( as separate components passed through do_actions)

Adjusting this markup is therefore a problem (classes need adding that exist on other tables with no means to currently) and altogether this much HTML ought to be under the control of frontend template files.

This ticket proposes and moves all functions into comparative positions in Nouveau include/{comp}/template-tags.php files and updates the do_action to a nouveau named one.

One issue is that BP core hooks a number of support functions to do_action(''bp_notification_settings') these either need to be copied over too and updated for new do_action or we ??? run the do_action in addition to our new one based on the fact it won't be actually rendering but will trigger necessary actions ( this sounds wrong though!)

hnla commented 7 years ago

Copied from Slack comment:

Need some Nouveau advice please: I'm currently trying to port over all the notifications (settings/email tab) tables for the screen so that we manage the humungeous amount of frontend html from accessible files rather than from core, this requires that I rename functions with a 'nouveau' slug portion all well and good & done... however currently & in Nouveau we render the table functions via a do_action( bp_notification_settings' ) updated with Nouveau slug problem that requires solution is: In BP core there are ~5 functions/hooks that work on testing for has_action or run the do_action to return a value into a function then used only in core ( bp_settings_get_registered_notification_keys() ) First solution was simply to copy the bulk of them over and run under adapted names, in theory fine. Two though present issues, the whitelist function & setup_admin_bar() which is a class both of thse are either a pain to replicate in Nouveau or as the whitelist keys exists not possible. 2:20 Possible alternative solution I'm considering? Given in Nouveau we no longer use bp_notification_settings hook to display content that this is used in addition to the Nouveau add_action for each table function thus fulfilling the requirements of core functions that simply check if it has_action and of the whitelist key function to pass the table functions through - this last one has me wondering though if that doesn't become a sort of double firing - 2:23 Does running the original do_action sound as possibly 'bad' as it does to me even though a possible solution?