Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ai-mu-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
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
Noblogs
ai-mu-plugins
Commits
c4601158
Commit
c4601158
authored
3 years ago
by
lucha
Browse files
Options
Downloads
Patches
Plain Diff
use hooks instead of patching themes to show ai credits
parent
39ee04c5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ai-credits.php
+25
-0
25 additions, 0 deletions
ai-credits.php
with
25 additions
and
0 deletions
ai-credits.php
0 → 100644
+
25
−
0
View file @
c4601158
<?php
/*
* Plugin Name: A/I - Credits
* Description: Show Autistici/Inventati credits in some themes' footers
* Version: 0.0.1
* Author: Autistici/Inventati
* Author URI: https://autistici.org
*/
function
ai_footer_credits
(){
echo
'<strong><a href="https://noblogs.org">Noblogs</a> is a project of <a href="https://www.autistici.org">R*</a></strong> | '
;
}
# defines a custom action hook, to be used when patching themes
# use this by adding in the footer.php file of the theme, at the appropriate location (usually before/after "Powered by Wordpress")
# <?php do_action( 'ai_credits' ); ?>
add_action
(
'ai_credits'
,
'ai_footer_credits'
);
# ten does have a _credits hook, but it not work nicely due to annoying image background to <a> elements set in the CSS of the theme
foreach
(
array
(
'eleven'
,
'twelve'
,
'thirteen'
,
'fourteen'
,
'fifteen'
,
'sixteen'
)
as
$year
){
add_action
(
'twenty'
.
$year
.
'_credits'
,
'ai_footer_credits'
);
}
?>
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