Skip to:

Opened 9 years ago

Closed 8 years ago

#6690 closed enhancement (fixed)

extend class-bp-xprofile-group.php with xprofile_group_after_group_description

Reported by: kmbdeamorg's profile kmb@… Owned by: boonebgorges's profile boonebgorges
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Extended Profile Keywords: has-patch commit
Cc: kmb@…



like the one in #5674 I need an action within the main part - almost like xprofile_field_after_contentbox in class-bp-xprofile-field.php

thanks in advance

+++ wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-group.php
@@ -693,6 +693,9 @@ class BP_XProfile_Group {
 									<textarea name="group_description" id="group_description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea>
+							<?php
+								do_action( 'xprofile_group_after_group_description', $this );
+							?>
 						</div><!-- #post-body-content -->
 						<div id="postbox-container-1" class="postbox-container">

Attachments (1)

6690.01.patch (860 bytes) - added by r-a-y 8 years ago.

Download all attachments as: .zip

Change History (9)

#1 @DJPaul
9 years ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 2.5

We'll take a look at this for the 2.5 release! Thanks!

#2 @r-a-y
8 years ago

  • Keywords reporter-feedback added; needs-testing removed
  • Milestone changed from 2.5 to 2.6

I'm trying to think why this hook would be needed as the requested hook is very specific.

Do you want to add some explanation for the xprofile field description for admins (eg. This will be displayed after the field is rendered on the frontend)? If so, maybe we can hardcode a description instead of using a hook.

Klaus - Can you say a bit about what you would be using this hook for?

In the meantime, I'm moving this to 2.6 to clear the milestone.

Last edited 8 years ago by r-a-y (previous) (diff)

#3 @kmb@…
8 years ago

  • Cc kmb@… added

Hi r-a-y,

sorry for answering late, but I did not get a notification.

It's not for a simple textual description. I've written an ACL-Plugin (not ready yet for public release) and the form-fields need some space. It's not enough to put the in the right column.
And because there is no hook in the center-part I've suggested this one like the one in class-bp-xprofile-field.php

kind regards

#4 @kmb@…
8 years ago

  • Keywords reporter-feedback removed

#5 @r-a-y
8 years ago

Thanks for the feedback, Klaus.

After looking into this more, I think the hook makes sense.

The only thing I'm wary about is the name of the hook. I know you were probably using the other hooks on the page as a guide (like 'xprofile_group_before_submitbox'), but since XProfile Groups are also shown on the frontend, 'xprofile_group_after_group_description' sounds a little too generic.

I'm thinking 'xprofile_group_admin_after_description' would be more suitable.

Could use other thoughts from core devs.

8 years ago

#6 @dcavins
8 years ago

@r-a-y I think your hook name makes sense, given where this would appear. Unless there are any objections, I'd say commit it.

#7 @DJPaul
8 years ago

  • Keywords commit added

#8 @boonebgorges
8 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 10720:

Introduce xprofile_group_admin_after_description action.

This allows developers to add content to the admin panel of an XProfile
field group.

Props kmb@…, r-a-y.
Fixes #6690.

Note: See TracTickets for help on using tickets.