• Resolved gingerbooch

    (@gingerbooch)


    Hi @gioni,

    I need to use the function “cerber_block_user()” within a script.
    For this purpose, I use the “require_once()” function to call “cerber-users.php”.

    Is it right or is there a safer way to call the “cerber_block_user()” function please ?

    • This topic was modified 1 year, 7 months ago by gingerbooch. Reason: Unable to delete the topic
    • This topic was modified 1 year, 7 months ago by gingerbooch. Reason: Remaining question
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author gioni

    (@gioni)

    That is the correct way. At the same time, the recommended, in terms of compatibility with features releases of WP Cerber, way is:

    
    include_once( 'set here your plugins directory path' . '/wp-cerber/cerber-load.php' );
    
    if ( function_exists( 'cerber_load_admin_code' ) ) {
    	cerber_load_admin_code();
    	cerber_block_user( $user_id, $msg, $note );
    }
    
    /*
    
    Parameters are:
    
    $user_id = User ID
    $msg = An optional message to be displayed on the login page when the user tries to log in
    $note = An optional note visible to website admins
    
    */
    Thread Starter gingerbooch

    (@gingerbooch)

    Many thanks for your answer ??

    Have a nice day,

    GB

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Block user with a script’ is closed to new replies.