Last active
July 10, 2018 11:47
-
-
Save bueltge/21c6ef6257ba9ceb4e7a96427a1ec64c to your computer and use it in GitHub Desktop.
Valéries Authenticator Plugin to exclude pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Valéries Authenticator Plugin to exclude pages | |
* Plugin URI: https://github.com/bueltge/Authenticator | |
* Description: This plugin extends the Authenticator plugin to exclude pages from the . | |
* Author: | |
* Version: 2018-07-10 | |
* Author URI: | |
* License: GPLv3+ | |
* License URI: ./assets/license.txt | |
* Textdomain: authenticator | |
*/ | |
// check for uses in WP | |
if ( ! function_exists( 'add_filter' ) ) { | |
echo "Hi there! I'm just a part of plugin, not much I can do when called directly."; | |
exit; | |
} | |
add_action( 'plugins_loaded', 'authenticator_valeries_add_exclude' ); | |
function authenticator_valeries_add_exclude() { | |
add_filter( 'authenticator_exclude_posts', 'authenticator_valeries_exclude_pages' ); | |
} | |
function authenticator_valeries_exclude_pages( $titles ) { | |
// For more as one title use the follow php function | |
array_push( | |
$titles, | |
'Accueil', 'FAQ', 'CGU', 'CGV', 'Formulaire de rétractation', 'Politique de confidentialité', 'Contact', | |
'A propos', 'Page des contributeurs', 'Statistiques', 'Histoires gratuites', 'Catégories', 'Auteurs', 'Titres', | |
'Soumettre un texte', 'Boutique' | |
); | |
return $titles; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment