Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Valéries Authenticator Plugin to exclude pages
<?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
You can’t perform that action at this time.