Make WordPress Core

Opened 14 years ago

Closed 9 years ago

#14664 closed enhancement (fixed)

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

Reported by: ramiy's profile ramiy Owned by:
Milestone: 3.9 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 14 years ago.

Download all attachments as: .zip

Change History (12)

@ramiy
14 years ago

#1 @ramiy
14 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');

#2 follow-up: @ramoonus
14 years ago

you tagged it for 3.1?

#3 @scribu
14 years ago

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

#4 @hakre
14 years ago

Nice find!

#5 in reply to: ↑ 2 @ramiy
14 years ago

Replying to ramoonus:

you tagged it for 3.1?

Yes, 3.1.

#6 @zeo
14 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">

#7 @ramiy
14 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.

#8 @ramiy
14 years ago

  • Cc ramiy added

#9 @nacin
14 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.

#10 @zeo
14 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 11 years ago by ocean90 (previous) (diff)

#11 @wonderboymusic
9 years ago

  • Milestone changed from Future Release to 3.9
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.