WordPress at Your Fingertips
function is not described

SimplePie_Parser::parse_hcard() private WP 1.0

{} It's a method of the class: SimplePie_Parser{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->parse_hcard( $data, $category );
$data (required)
-
$category **
-
Default: false

Code of SimplePie_Parser::parse_hcard() WP 5.8.2

private function parse_hcard($data, $category = false) {
	$name = '';
	$link = '';
	// Check if h-card is set and pass that information on in the link.
	if (isset($data['type']) && in_array('h-card', $data['type'])) {
		if (isset($data['properties']['name'][0])) {
			$name = $data['properties']['name'][0];
		}
		if (isset($data['properties']['url'][0])) {
			$link = $data['properties']['url'][0];
			if ($name === '') {
				$name = $link;
			}
			else {
				// can't have commas in categories.
				$name = str_replace(',', '', $name);
			}
			$person_tag = $category ? '<span class="person-tag"></span>' : '';
			return '<a class="h-card" href="'.$link.'">'.$person_tag.$name.'</a>';
		}
	}
	return isset($data['value']) ? $data['value'] : '';
}