<success_msg>

The Ninja Forms success msg shortcode.


Usage

  1. // assign value 
  2. $success_msg = 'dynamic_tag'; 
  3.  
  4. // basic usage 
  5. echo do_shortcode("[$success_msg]"); 
  1. // assign value 
  2. $success_msg = 'dynamic_tag'; 
  3.  
  4. // variable usage 
  5. $result = do_shortcode("[$success_msg]"); 
  6. echo $result;  

Defined (3)

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

/deprecated/classes/notification-success-message.php  
  1. // If our name is empty, we need to generate a random string. 
  2. if ( empty ( $name ) ) { 
  3. $name = ninja_forms_random_string( 4 ); 
  4. $success_msg = apply_filters( 'nf_success_msg', Ninja_Forms()->notification( $id )->get_setting( 'success_msg' ), $id ); 
  5. $success_msg = do_shortcode( wpautop( $success_msg ) ); 
  6. $success_msg = nf_parse_fields_shortcode( $success_msg ); 
  7. $ninja_forms_processing->add_success_msg( 'success_msg-' . $name, $success_msg ); 
  8.  
/includes/Actions/SuccessMessage.php  
  1. if( ! isset( $data[ 'actions' ] ) || ! isset( $data[ 'actions' ][ 'success_message' ] ) ) { 
  2. $data[ 'actions' ][ 'success_message' ] = ''; 
  3.  
  4. ob_start(); 
  5. do_shortcode( $action_settings['success_msg'] ); 
  6. $ob = ob_get_clean(); 
  7.  
  8. if( $ob ) { 
  9. $data[ 'debug' ][ 'console' ][] = sprintf( __( 'Shortcodes should return and not echo, see: %s', 'ninja-forms' ), 'https://codex.wordpress.org/Shortcode_API#Output' ); 
  10. $data['actions']['success_message'] .= $action_settings['success_msg']; 
  1.  
  2. if( $ob ) { 
  3. $data[ 'debug' ][ 'console' ][] = sprintf( __( 'Shortcodes should return and not echo, see: %s', 'ninja-forms' ), 'https://codex.wordpress.org/Shortcode_API#Output' ); 
  4. $data['actions']['success_message'] .= $action_settings['success_msg']; 
  5. } else { 
  6. $data['actions']['success_message'] .= do_shortcode( $action_settings['success_msg'] ); 
  7.  
  8. return $data;