WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 3 months ago

#14664 new enhancement

add <link rel="profile" ... /> to wp_head()

Reported by: ramiy Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.0.1
Component: Themes Keywords: has-patch
Focuses: Cc:

Description

Old themes use rel="profile" in <head>, twentyten use it in <link>.

Both ways are ok (http://microformats.org/wiki/rel-profile), and i think <link> is better (like in twentyten).

Currently, theme authors add the profile rel manually. They usualy use XFN 1.1 profile (http://gmpg.org/xfn/11). To change the profile users need to change the template files. This is problematic.

I think we need to add a profile_rel_link function to wp core and add it to wp_head(). This way, when we want to change the profile, we will use filters.

See the attacment.

Attachments (1)

profile-rel.patch (1.3 KB) - added by ramiy 4 years ago.

Download all attachments as: .zip

Change History (11)

ramiy4 years ago

comment:1 ramiy4 years ago

To change the profile to XEN 1.0, use something like:

function custom_profile_rel_link() {

return '<link rel='profile' href='http://xen.adactio.com/' />\n';

}
add_filter('profile_rel_link','custom_profile_rel_link');

comment:2 follow-up: ramoonus4 years ago

you tagged it for 3.1?

comment:3 scribu4 years ago

  • Component changed from General to Themes
  • Keywords has-patch added

comment:4 hakre4 years ago

Nice find!

comment:5 in reply to: ↑ 2 ramiy4 years ago

Replying to ramoonus:

you tagged it for 3.1?

Yes, 3.1.

comment:6 zeo4 years ago

IMHO this isn't about OLD VS 2010 theme. It's basically HTML4 VS HTML5.

HTML4 introduce profile attribute from HEAD. Then HTML5 drops profile attribute from HEAD and then it's suggested to add rel="profile" to LINK.

Perhaps not to be added to default filters but as add_theme_support('profile_rel_link') or something similar to avoid multiple profile defined.

Since twentyten is tagged with microformats this is currently the correct profile URI: <link rel="profile" href="http://microformats.org/profile/specs http://microformats.org/profile/hatom" />. And for "OLD" theme: <head profile="http://microformats.org/profile/specs http://microformats.org/profile/hatom">

comment:7 ramiy4 years ago

add_theme_support('profiles') registers major wordpress feature like custom-header, custom-background, post-thumbnails, menus and more.

add_action('wp_head','profile_rel_link',1) addes simple <link> element to <head>.

The use of theme support sounds good BUT in this case i prefer to use a simple head action. "rel-profiles" is not a wordpress feature, it a simple head element indicates that microformat's vocabulary is formally defined in the document.

comment:8 ramiy4 years ago

  • Cc ramiy added

comment:9 nacin3 years ago

  • Milestone changed from Awaiting Review to Future Release

I'm considering a way for a theme to specifically opt-in to HTML5 goodies such as this.

comment:10 zeo3 years ago

According to Theme Review:

"Correct XFN profile link in <head> tag: <head profile="http://gmpg.org/xfn/11"> (Exception: Wholly HTML 5 themes must not have the profile, as HTML 5 does not support it.)"

Further reading:

Last edited 3 months ago by ocean90 (previous) (diff)
Note: See TracTickets for help on using tickets.