nf_parse_sub_seq_num_shortcode

Parse the [nf_sub_seq_num] shortcode.

Description

(string) nf_parse_sub_seq_num_shortcode( $setting, (string) $setting_name = '', (string) $id = '' ); 

Returns (string)

$setting

Parameters (3)

0. $setting
The setting.
1. $setting_name — Optional. (string) => ''
The setting name.
2. $id — Optional. (string) => ''
The id.

Usage

  1. if ( !function_exists( 'nf_parse_sub_seq_num_shortcode' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/shortcode.php'; 
  3.  
  4. // The setting. 
  5. $setting = null; 
  6.  
  7. // The setting name. 
  8. $setting_name = ''; 
  9.  
  10. // The id. 
  11. $id = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = nf_parse_sub_seq_num_shortcode($setting, $setting_name, $id); 
  15.  

Defined (1)

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

/deprecated/includes/shortcode.php  
  1. function nf_parse_sub_seq_num_shortcode( $setting, $setting_name = '', $id = '' ) { 
  2. global $ninja_forms_processing; 
  3.  
  4. if ( ! is_object( $ninja_forms_processing ) ) 
  5. return $setting; 
  6.  
  7. $sub_id = $ninja_forms_processing->get_form_setting( 'sub_id' ); 
  8. if ( empty ( $sub_id ) ) 
  9. return $setting; 
  10.  
  11. $seq_num = Ninja_Forms()->sub( $sub_id )->get_seq_num(); 
  12.  
  13. $setting = str_replace( '[nf_sub_seq_num]', $seq_num, $setting ); 
  14. return $setting;