nf_not_logged_in_msg

Adds our not logged-in message if the user is not logged-in and the form requires the user to be logged-in.

Description

nf_not_logged_in_msg( $form_id ); 

Parameters (1)

0. $form_id
The form id.

Usage

  1. if ( !function_exists( 'nf_not_logged_in_msg' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/display/form/not-logged-in.php'; 
  3.  
  4. // The form id. 
  5. $form_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = nf_not_logged_in_msg($form_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/deprecated/includes/display/form/not-logged-in.php  
  1. function nf_not_logged_in_msg( $form_id ) { 
  2. $not_logged_in = Ninja_Forms()->form( $form_id )->get_setting( 'logged_in' ); 
  3. if ( ! is_user_logged_in() && 1 == $not_logged_in ) { 
  4. $not_logged_in_msg = Ninja_Forms()->form( $form_id )->get_setting( 'not_logged_in_msg' ); 
  5. echo do_shortcode( $not_logged_in_msg );