cf_custom_fields_render

Render fields in editor.

Description

cf_custom_fields_render( (object) $post, (array) $args ); 

Parameters (2)

0. $post (object)
Post object.
1. $args (array)
The args.

Usage

  1. if ( !function_exists( 'cf_custom_fields_render' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'caldera-custom-fields/includes/metabox.php'; 
  3.  
  4. // Post object. 
  5. $post = null; 
  6.  
  7. // The args. 
  8. $args = array(); 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = cf_custom_fields_render($post, $args); 
  12.  

Defined (2)

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

/includes/metabox.php  
  1. function cf_custom_fields_render($post, $args) { 
  2. if(isset($_GET['cf_su'])) { 
  3. unset($_GET['cf_su']); 
  4. add_filter( 'caldera_forms_render_form_element', function( $element ) { 
  5. return 'div'; 
  6. } ); 
  7. ob_start(); 
  8. echo Caldera_Forms::render_form( $args['id'] ); 
  9.  
  10. $form = str_replace('_cf_verify', 'metabox_cf_verify', ob_get_clean()); 
  11.  
  12. // register this form for processing' 
  13. echo '<input type="hidden" name="cf_metabox_forms[]" value="' . $args['id'] . '">'; 
  14. echo $form; 
  15.  
  1. function cf_custom_fields_render($post, $args) { 
  2. if(isset($_GET['cf_su'])) { 
  3. unset($_GET['cf_su']); 
  4. add_filter( 'caldera_forms_render_form_element', function( $element ) { 
  5. return 'div'; 
  6. } ); 
  7. ob_start(); 
  8. echo Caldera_Forms::render_form( $args['id'] ); 
  9.  
  10. $form = str_replace('_cf_verify', 'metabox_cf_verify', ob_get_clean()); 
  11.  
  12. // register this form for processing' 
  13. echo '<input type="hidden" name="cf_metabox_forms[]" value="' . $args['id'] . '">'; 
  14. echo $form; 
  15.