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
if ( !function_exists( 'nf_not_logged_in_msg' ) ) { require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/display/form/not-logged-in.php'; } // The form id. $form_id = null; // NOTICE! Understand what this does before running. $result = nf_not_logged_in_msg($form_id);
Defined (1)
The function is defined in the following location(s).
- /deprecated/includes/display/form/not-logged-in.php
- function nf_not_logged_in_msg( $form_id ) {
- $not_logged_in = Ninja_Forms()->form( $form_id )->get_setting( 'logged_in' );
- if ( ! is_user_logged_in() && 1 == $not_logged_in ) {
- $not_logged_in_msg = Ninja_Forms()->form( $form_id )->get_setting( 'not_logged_in_msg' );
- echo do_shortcode( $not_logged_in_msg );
- }
- }