Skip to content
Snippets Groups Projects
Commit 3f2022ca authored by root's avatar root Committed by lechuck
Browse files

Adding plugin rss-license

parent c3616955
No related branches found
No related tags found
No related merge requests found
=== RSS License ===
Contributors: patrys
Donate link: http://room-303.com/blog/postaw-piwo/
Tags: feed, license
Requires at least: 2.0.11
Tested up to: 2.9
Stable tag: 0.1
Allows one to include the wpLicense copyright in blog feeds.
== Description ==
This plugin will add a copyright footer to your feeds. Each footer contains a permalink, author info and the license.
Currently footers are not appended to the excerpts as it's not common to steal these.
== Installation ==
1. Make sure wpLicense is installed and working
1. Upload `rss-license` to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
== Changelog ==
= 0.1 =
First version released.
<?php
/*
Plugin Name: RSS License
Version: 0.1
Plugin URI: http://room-303.com/blog/
Description: Allows one to include the wpLicense copyright in blog feeds.
Author: Patryk Zawadzki
Author URI: http://room-303.com/blog/
*/
function append_rss_license($contents) {
if (!is_feed())
return $contents;
$license_uri = get_option('cc_content_license_uri');
$license_name = get_option('cc_content_license');
$license_attribName = get_option('cc_content_attributionName');
$license_attribURL = get_option('cc_content_attributionURL');
$result = '<a href="'.get_permalink().'">'.get_the_title().'</a> &copy;';
if($license_attribURL) {
$result .= ' <a href="'.$license_attribURL.'" rel="cc:attributionURL">';
}
if($license_attribName)
$result .= $license_attribName;
else {
$result .= $license_attribURL;
}
if($license_attribURL) {
$result .= '</a>';
}
$result .= ', <a rel="license" href="'.$license_uri.'">'.$license_name.'</a>.';
return $contents . '<p><small>'.$result.'</small></p>';
}
add_filter('the_content', 'append_rss_license');
//add_filter('the_excerpt_rss', 'append_rss_license');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment