ninja_forms_display_sub_number_remaining_shortcode

Shortcode for ninja_forms_display_sub_number_remaining.

Description

(int) ninja_forms_display_sub_number_remaining_shortcode( $atts ); 

Returns (int)

Parameters (1)

0. $atts
The atts.

Usage

  1. if ( !function_exists( 'ninja_forms_display_sub_number_remaining_shortcode' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/shortcode.php'; 
  3.  
  4. // The atts. 
  5. $atts = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ninja_forms_display_sub_number_remaining_shortcode($atts); 
  9.  

Defined (1)

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

/deprecated/includes/shortcode.php  
  1. function ninja_forms_display_sub_number_remaining_shortcode( $atts ) { 
  2. $form = Ninja_Forms()->form($atts[ 'id' ]); 
  3.  
  4. if( isset( $form->settings[ 'sub_limit_number' ] ) ) { 
  5. $sub_count = nf_get_sub_count( $atts[ 'id' ] ); 
  6. $sub_limit = (int) $form->settings[ 'sub_limit_number' ]; 
  7.  
  8. if( $sub_count > $sub_limit ) 
  9. return 0; 
  10.  
  11. return $sub_limit - $sub_count; 
  12. else { 
  13. return null;