Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bueltge
Last active July 10, 2018 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bueltge/21c6ef6257ba9ceb4e7a96427a1ec64c to your computer and use it in GitHub Desktop.
Save bueltge/21c6ef6257ba9ceb4e7a96427a1ec64c to your computer and use it in GitHub Desktop.
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