BP_XProfile_Field_Type_Social_Networks::is_valid( int $values = '' )

Check if valid.

Description

Parameters

$values

(int) (Optional) post id.

Default value: ''

Return

(bool)

Source

File: bp-xprofile/classes/class-bp-xprofile-field-type-social-networks.php

	public function is_valid( $values = '' ) {

		global $wpdb;

		if ( empty( $values ) ) {
			return true;
		}

		$valid = false;
		if ( is_array( $values ) ) {
			foreach ( $values as $value ) {
				if ( '' === $value || filter_var( $value, FILTER_VALIDATE_URL) ) {
					$valid = true;
				} else {
					return false;
				}
			}
		} else {
			return false;
		}

		if ( true === $valid ) {
			return true;
		}
		return false;


	}

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.