public function add_opengraph_namespace($input)
{
$namespaces = array('og: http://ogp.me/ns#');
if ($this->options['fbadminapp'] != 0 || is_array($this->options['fb_admins']) && $this->options['fb_admins'] !== array()) {
$namespaces[] = 'fb: http://ogp.me/ns/fb#';
}
/**
* Allow for adding additional namespaces to the <html> prefix attributes.
*
* @since 3.9.0
*
* @param array $namespaces Currently registered namespaces which are to be
* added to the prefix attribute.
* Namespaces are strings and have the following syntax:
* ns: http://url.to.namespace/definition
*/
$namespaces = apply_filters('wpseo_html_namespaces', $namespaces);
$namespace_string = implode(' ', array_unique($namespaces));
if (strpos($input, ' prefix=') !== false) {
$regex = '`prefix=([\'"])(.+?)\\1`';
$replace = 'prefix="$2 ' . $namespace_string . '"';
$input = preg_replace($regex, $replace, $input);
} else {
$input .= ' prefix="' . $namespace_string . '"';
}
return $input;
}