bp_xprofile_is_richtext_enabled_for_field( int|null $field_id = null )
Is rich text enabled for this profile field?
Description
By default, rich text is enabled for textarea fields and disabled for all other field types.
Parameters
- $field_id
-
(Optional) Default current field ID.
Default value: null
Return
(bool)
Source
File: bp-xprofile/bp-xprofile-functions.php
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 | function bp_xprofile_is_richtext_enabled_for_field( $field_id = null ) { if ( ! $field_id ) { $field_id = bp_get_the_profile_field_id(); } $field = xprofile_get_field( $field_id ); $enabled = false; if ( $field instanceof BP_XProfile_Field ) { $enabled = (bool) $field ->type_obj->supports_richtext; } /** * Filters whether richtext is enabled for the given field. * * @since BuddyPress 2.4.0 * * @param bool $enabled True if richtext is enabled for the field, otherwise false. * @param int $field_id ID of the field. */ return apply_filters( 'bp_xprofile_is_richtext_enabled_for_field' , $enabled , $field_id ); } |
Changelog
Version | Description |
---|---|
BuddyPress 2.4.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.