Changeset 10254 for trunk/src/bp-xprofile/bp-xprofile-functions.php
- Timestamp:
- 10/12/2015 05:50:45 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-xprofile/bp-xprofile-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-functions.php
r10233 r10254 1021 1021 1022 1022 /** 1023 * Is rich text enabled for this profile field? 1024 * 1025 * By default, rich text is enabled for textarea fields and disabled for all other field types. 1026 * 1027 * @since 2.4.0 1028 * 1029 * @param int $field_id Optional. Default current field ID. 1030 * @return bool 1031 */ 1032 function bp_xprofile_is_richtext_enabled_for_field( $field_id = null ) { 1033 if ( ! $field_id ) { 1034 $field_id = bp_get_the_profile_field_id(); 1035 } 1036 1037 $field = xprofile_get_field( $field_id ); 1038 1039 $enabled = false; 1040 if ( $field instanceof BP_XProfile_Field ) { 1041 $enabled = (bool) $field->type_obj->supports_richtext; 1042 } 1043 1044 /** 1045 * Filters whether richtext is enabled for the given field. 1046 * 1047 * @since 2.4.0 1048 * 1049 * @param bool $enabled True if richtext is enabled for the field, otherwise false. 1050 * @param int $field_id ID of the field. 1051 */ 1052 return apply_filters( 'bp_xprofile_is_richtext_enabled_for_field', $enabled, $field_id ); 1053 } 1054 1055 /** 1023 1056 * Get visibility levels out of the $bp global. 1024 1057 *
Note: See TracChangeset
for help on using the changeset viewer.