Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
noblogs-wp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai
noblogs-wp
Commits
3f2022ca
Commit
3f2022ca
authored
14 years ago
by
root
Committed by
lechuck
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Adding plugin rss-license
parent
c3616955
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
wp-content/plugins/rss-license/readme.txt
+26
-0
26 additions, 0 deletions
wp-content/plugins/rss-license/readme.txt
wp-content/plugins/rss-license/rss-license.php
+39
-0
39 additions, 0 deletions
wp-content/plugins/rss-license/rss-license.php
with
65 additions
and
0 deletions
wp-content/plugins/rss-license/readme.txt
0 → 100644
+
26
−
0
View file @
3f2022ca
=== 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.
This diff is collapsed.
Click to expand it.
wp-content/plugins/rss-license/rss-license.php
0 → 100644
+
39
−
0
View file @
3f2022ca
<?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> ©'
;
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');
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment