Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML prefix attribute #356

Open
Tsquare17 opened this issue Dec 8, 2018 · 0 comments
Open

HTML prefix attribute #356

Tsquare17 opened this issue Dec 8, 2018 · 0 comments

Comments

@Tsquare17
Copy link
Member

The prefix attribute is added by SEO plugins like Yoast and All in One SEO with Social meta. This results in output such as the following.

Yoast:
<html lang="en-US" prefix="og:" http://ogp_me/ns#="">

All in One SEO Pack with Social Meta
<html lang="en-US prefix=og:" http://ogp_me/ns#="">

I think at least part of the problem is due to the valid space it contains (https://www.w3.org/TR/rdfa-core/#A-prefix) being improperly filtered.

Both plugins add the attribute via add_filter() on language_attributes.

The issue can be replicated by attempting to add the prefix attribute from functions.php with the following:

add_filter( 'language_attributes', 'html_prefix' );
function html_prefix( $atts ) {
	$prefix = 'prefix="og: http://ogp.me/ns#"';
	$atts  .= ' ' . $prefix;
	return $atts;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant