bp_ps_escaped_filters_data47()

Escape BuddyBoss profile search filter data version 4.7.

Description

Source

File: bp-core/profile-search/bps-templates47.php

function bp_ps_escaped_filters_data47() {
	list ( $request, $full ) = bp_ps_template_args();

	$F         = new stdClass;
	$action    = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
	$action    = add_query_arg( BP_PS_FORM, 'clear', $action );
	$F->action = $full ? esc_url( $action ) : '';
	$F->fields = array();

	$fields = bp_ps_parse_request( $request );
	foreach ( $fields as $f ) {
		if ( ! isset ( $f->filter ) ) {
			continue;
		}
		if ( ! bp_ps_Fields::set_display( $f, $f->filter ) ) {
			continue;
		}

		if ( empty ( $f->label ) ) {
			$f->label = $f->name;
		}

		$f->min    = isset ( $f->value['min'] ) ? $f->value['min'] : '';
		$f->max    = isset ( $f->value['max'] ) ? $f->value['max'] : '';
		$f->values = (array) $f->value;

		/**
		 * @todo add title/description
		 *
		 * @since BuddyBoss 1.0.0
		 */
		do_action( 'bp_ps_field_before_filters', $f );
		$F->fields[] = $f;
	}

	/**
	 * @todo add title/description
	 *
	 * @since BuddyBoss 1.0.0
	 */
	do_action( 'bp_ps_before_filters', $F );
	usort( $F->fields, 'bp_ps_sort_fields' );

	foreach ( $F->fields as $f ) {
		$f->label = esc_attr( $f->label );
		if ( ! is_array( $f->value ) ) {
			$f->value = esc_attr( stripslashes( $f->value ) );
		}
		foreach ( $f->values as $k => $value ) {
			$f->values[ $k ] = stripslashes( $value );
		}

		foreach ( $f->options as $key => $label ) {
			$f->options[ $key ] = esc_attr( $label );
		}
	}

	return $F;
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.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.