xprofile_filtered_data_value_before_save

  • apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value )

    Source Reference:

    • Component: BuddyPress :: bp-xprofile
      File: /bp-xprofile/bp-xprofile-filters.php :: Trac Source Line: 91
      		return;
      
      	// Value might be serialized
      	$field_value = maybe_unserialize( $field_value );
      
      	// Filter single value
      	if ( !is_array( $field_value ) ) {
      		$kses_field_value     = xprofile_filter_kses( $field_value );
      		$filtered_field_value = wp_rel_nofollow( force_balance_tags( $kses_field_value ) );
      		$filtered_field_value = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value );
      
      	// Filter each array item independently
      	} else {
      		$filtered_values = array();
      		foreach ( (array)$field_value as $value ) {
      			$kses_field_value       = xprofile_filter_kses( $value );
      			$filtered_value 	= wp_rel_nofollow( force_balance_tags( $kses_field_value ) );
      			$filtered_values[] = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_value, $value );
      
      		}
      
  • apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_value, $value )

    Source Reference:

    • Component: BuddyPress :: bp-xprofile
      File: /bp-xprofile/bp-xprofile-filters.php :: Trac Source Line: 99
      		$filtered_field_value = wp_rel_nofollow( force_balance_tags( $kses_field_value ) );
      		$filtered_field_value = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value );
      
      	// Filter each array item independently
      	} else {
      		$filtered_values = array();
      		foreach ( (array)$field_value as $value ) {
      			$kses_field_value       = xprofile_filter_kses( $value );
      			$filtered_value 	= wp_rel_nofollow( force_balance_tags( $kses_field_value ) );
      			$filtered_values[] = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_value, $value );
      
      		}
      
      		if ( $reserialize )
      			$filtered_field_value = serialize( $filtered_values );
      		else
      			$filtered_field_value = $filtered_values;
      	}
      
      	return $filtered_field_value;
      

Hook: add_filter: xprofile_filtered_data_value_before_save instances (1)

  • add_filter( 'xprofile_filtered_data_value_before_save', 'trim', 2 )
    $tag: xprofile_filtered_data_value_before_save
    $function_to_add: trim
    $priority: 2
    $accepted_args: 0

    Source Reference:

    • Component: BuddyPress :: bp-xprofile
      File: /bp-xprofile/bp-xprofile-filters.php :: Trac Source Line: 48
      add_filter( 'xprofile_get_field_data',                'stripslashes' );
      
      /* Custom BuddyPress filters */
      
      add_filter( 'bp_get_the_profile_field_value',         'xprofile_filter_format_field_value', 1, 2 );
      add_filter( 'bp_get_the_site_member_profile_data',    'xprofile_filter_format_field_value', 1, 2 );
      add_filter( 'bp_get_the_profile_field_value',         'xprofile_filter_link_profile_data', 9, 2 );
      
      add_filter( 'xprofile_data_value_before_save',        'xprofile_sanitize_data_value_before_save', 1, 2 );
      add_filter( 'xprofile_filtered_data_value_before_save', 'trim', 2 );
      
      /**
       * xprofile_filter_kses ( $content )
       *
       * Run profile field values through kses with filterable allowed tags.
       *
       * @param string $content
       * @return string $content
       */
      function xprofile_filter_kses( $content ) {
      

Comments are closed.