PHP code example of helsingborg-stad / modularity-login-form

1. Go to this page and download the library: Download helsingborg-stad/modularity-login-form library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

helsingborg-stad / modularity-login-form example snippets


add_filter('modularityLoginForm/AbortLogin', function($message, WP_User $user) {

    //Check that anoter message isen't set before
    if($message === false) {
        if($user->ID = 1) {
            $message = __("You sir may not login.", 'plugin-text-domain');
        }
        if($user->ID = 2) {
            $message = __("Your account has been suspended.", 'plugin-text-domain');
        }
    }

    return $message; 

}, 10, 2);