Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#6575 closed enhancement (fixed)

Make the (required) portion of the Xprofile field label filterable

Reported by: garrett-eclipse Owned by: dcavins
Milestone: 2.4 Priority: normal
Severity: normal Version: 2.3.2
Component: Extended Profile Keywords: dev-feedback
Cc:

Description

Hello,

Full details on my support request - https://buddypress.org/support/topic/feature-request-filterable-xprofile-field-labels/#post-242779

In short I'd like the '(required)' text of the Xprofile field label to be filterable so it can be replaced where appropriate. In my case I'd like to replace it when the field is implemented on the Woocommerce checkout page so the denotation of required matches the Woocommerce fields.

Code to Amend;

<label for="<?php bp_the_profile_field_input_name(); ?>">
	<?php bp_the_profile_field_name(); ?>
	<?php if ( bp_get_the_profile_field_is_required() ) : ?>
		<?php esc_html_e( '(required)', 'buddypress' ); ?>
	<?php endif; ?>
</label>

Suggested fix could either be implementing the filter here directly or by setting up a function bp_the_profile_field_input_required() which implements the filter.

Thank you
P.S. A current js workaround is posted on the original support ticket.

Change History (4)

#1 @dcavins
5 years ago

I'd like to fix this at the same time as #6521. See that ticket for my suggested fix.

#2 @DJPaul
5 years ago

  • Milestone changed from Awaiting Review to 2.4

#3 @dcavins
5 years ago

New patch on #6521. Please take a look if you're interested. Thanks!

#4 @dcavins
5 years ago

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

In 10179:

Introduce bp_the_profile_field_required_label().

Introduce a new template function,
bp_the_profile_field_required_label(), that
allows for translation and filtration of
‘required’ label for use with extended profile
fields.

Fixes #6521 and #6575.

Note: See TracTickets for help on using tickets.