/deprecated/includes/admin/pages/ninja-forms/tabs/field-settings/sidebars/post-fields.php

  1. <?php if ( ! defined( 'ABSPATH' ) ) exit; 
  2.  
  3. // For backwards compatibilty, make sure that this function doesn't already exist. 
  4. if ( !function_exists ( 'ninja_forms_register_field_post_tags' ) ) { 
  5. function ninja_forms_register_sidebar_post_fields() { 
  6. $add_field = apply_filters( 'ninja_forms_use_post_fields', false ); 
  7. if ( !$add_field ) 
  8. return false; 
  9.  
  10. if(isset($_REQUEST['form_id'])) { 
  11. $form_id = absint( $_REQUEST['form_id'] ); 
  12. }else{ 
  13. $form_id = ''; 
  14. if( function_exists( 'ninja_forms_get_current_tab' ) ) { 
  15. $current_tab = ninja_forms_get_current_tab(); 
  16. if($form_id != '' AND $current_tab == 'fields') { 
  17. $form_row = ninja_forms_get_form_by_id($form_id); 
  18. if(is_array($form_row) AND !empty($form_row)) { 
  19. $form_data = $form_row['data']; 
  20. if( isset( $form_data['create_post'] ) ) { 
  21. $create_post = $form_data['create_post']; 
  22. }else{ 
  23. $create_post = ''; 
  24.  
  25. }else{ 
  26. $create_post = ''; 
  27. }else{ 
  28. $create_post = ''; 
  29. $args = array( 
  30. 'name' => 'Post Creation Fields',  
  31. 'page' => 'ninja-forms',  
  32. 'tab' => 'builder',  
  33. 'display_function' => 'ninja_forms_sidebar_display_fields' 
  34. ); 
  35. if($create_post == 1) { 
  36. if( function_exists( 'ninja_forms_register_sidebar' ) ) { 
  37. ninja_forms_register_sidebar('post_fields', $args); 
  38.  
  39. add_action( 'admin_init', 'ninja_forms_register_sidebar_post_fields' ); 
.