buddypress / next-template-packs

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

To Do or Not to Do _actions #6

Closed hnla closed 8 years ago

hnla commented 8 years ago

Opened to raise this issue - touched on briefly in a devchat - and ponder further on what we want to do. with do_actions() in templates.

Personally I do not like the general template one that suggests any old content might be pushed out in an area that is simply devoid of any structure e.g.: do_action( 'bp_before_directory_activity' );

I propose to remove all these as found, retaining only the more specific ones that devs would know are intended to carry a certain type of element i.e filter li item.

imath commented 8 years ago

I'm in favor of removing as much as we can, and use template tags when really needed

mercime commented 8 years ago
hnla commented 8 years ago

Cool. Do we agree that we need certain ones e.g those in filter selects as this may be what's worrying me in removing stuff that plugins may be using?

imath commented 8 years ago

I understand your point here, but i'm now sure we need to remove all do_actions() that are in templates. This means even the ones you're talking about (i have a plan for those ;) ). So i suggest that if we need/want to use a do_action(), it must be in a template-tag.

hnla commented 8 years ago

I'm cool with that and means that I can and will remove any do_actions as they are found, if they're found.

imath commented 8 years ago

:) I had a thought about it, we should provide some feedback although. I've created the function bp_nouveau_get_forsaken_hooks so that we can inform developers of forsaken hooks and eventually provide a way to achieve their actions in BP Nouveau. I'd suggest you add the removed hooks into the array ;)

hnla commented 8 years ago

Now that's brought a smile to my face, this function name is wonderful and mustn't be changed bp_nouveau_get_forsaken_hooks

I'll try and remember to add removed ones to this function.

hnla commented 8 years ago

from now on we name all our functions as though Shakespeare wrote them :)

hnla commented 8 years ago

but are they 'forsaken' or 'forlorn' ?

imath commented 8 years ago

ahaha! Google translate gave me this for 'Abandonné" but if you think it's a bit too weird you can change the name :)

hnla commented 8 years ago

Google is a nob head :) Abandonné === abandon or past definite as 'abandoned' this item has been abandoned or so I'm assuming.

Just loving forsaken , we seldom use our rich language(s) to their fullest.

imath commented 8 years ago

I've found another reason why template tags are better than adding do_action into templates. Each time the members loop is used (eg: the friends of the user) the hooks of the members loop are firing and most of them are named like bp_directory_members_thing which can give a false information to the developer.. I've left it this way, but i feel we should only fire these hooks if bp_is_members_directory()...