Skip to content

Commit

Permalink
more and better doku
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle committed Apr 20, 2010
1 parent 59234fd commit 1e9c3f4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
10 changes: 5 additions & 5 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
Plugin Name: /.well-known/
Plugin URI: http://notizblog.org/
Description: This plugin enables "Well-Known URIs" support for WordPress (RFC 5785: http://tools.ietf.org/html/rfc5785).
Version: 0.1
Version: 0.2
Author: Matthias Pfefferle
Author URI: http://notizblog.org/
*/

//
add_filter('query_vars', array('WellKnown', 'queryVars'));
add_action('parse_request', array('WellKnown', 'delegateRequest'));
add_action('generate_rewrite_rules', array('WellKnown', 'rewriteRules'));
add_filter('query_vars', array('WellKnownPlugin', 'queryVars'));
add_action('parse_request', array('WellKnownPlugin', 'delegateRequest'));
add_action('generate_rewrite_rules', array('WellKnownPlugin', 'rewriteRules'));

/**
* well-known class
*
* @author Matthias Pfefferle
*/
class WellKnown {
class WellKnownPlugin {
/**
* Add 'well-known' as a valid query variables.
*
Expand Down
33 changes: 28 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: Matthias Pfefferle
Donate link:
Tags: OpenID, XRD, well-known, XML, Discovery
Requires at least: 2.8
Tested up to: 2.9
Stable tag: 0.1
Requires at least: 2.7
Tested up to: 2.9.9
Stable tag: 0.2

This plugin enables "Well-Known URIs" support for WordPress (RFC 5785: http://tools.ietf.org/html/rfc5785).

Expand Down Expand Up @@ -37,8 +37,9 @@ From the RFC:

== Changelog ==

= 0.2 =
* Better doku
= 0.1 =

* Initial release

== Installation ==
Expand All @@ -47,4 +48,26 @@ From the RFC:
2. Activate the plugin through the *Plugins* menu in WordPress
3. ...and that's it :)

== Faq ==
== Frequently Asked Questions ==

= How can I define a well-known uri? =

Set a callback for an URI (/.well-known/robots.txt)

`add_filter('well-known', array('RobotsTxt', 'hostMetaUri'));
function hostMetaUri($wellKnown) {
return $wellKnown[] = array('robots.txt' => array('RobotsTxt', 'printHostMeta'));
}`

Print robots.txt:

`function printHostMeta() {
header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
echo "User-agent: *";
echo "Allow: /";
}`

= Is there an implementation where I can write off? =

Yes, you can find an example plugin, which defines a well-known-uri,
here: http://wordpress.org/extend/plugins/host-meta/

0 comments on commit 1e9c3f4

Please sign in to comment.