Skip to content
Snippets Groups Projects
Commit c4601158 authored by lucha's avatar lucha
Browse files

use hooks instead of patching themes to show ai credits

parent 39ee04c5
Branches
No related tags found
No related merge requests found
<?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');
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment