Create Posts Field – Show Customized Content

My posts dynamically appear in many locations on my site and I need the entire contents of the ‘customized content’ to appear by default rather than only having a choice between individual fields. (see screenshot)

How can I achieve this?


Attachment:
Screen Shot 2012-09-14 at 1.55.18 PM

This is not currently an option without custom code, but we are working on this for the next release. In the next release with the settings in your screenshot (no field selected for post content), the "customize content" box will be used instead. I'll be looking into this sometime over the next week. If possible, would you like some changes to make to allow this to work now?

absolutely would love the changes to get it going now. Thank you

By "now", I meant sometime over the next week when I get to this feature. Just to clarify.

that is great. I will keep my eye out.

Thank you

Okay.. this went faster than I thought it would. We've heavily rewritten the way custom displays work, so there are some changes in the code I'm giving you versus what will be included in the next version. Line numbers also won't match up right, so you'll need to look for the code.

1. Open formidable/pro/classes/models/FrmProEntry.php
2. Change line 224 from:
$this->insert_post($entry_id, $post, true);
to:
$this->insert_post($entry_id, $post, true, $form_id);

3. Change line 258 from:
$post_id = $this->insert_post($entry_id, $post);
to:
$post_id = $this->insert_post($entry_id, $post, false, $form_id);

4. Change line 269ish from:
function insert_post($entry_id, $post, $editing=false){

to:
function insert_post($entry_id, $post, $editing=false, $form_id=false){

5. Go to line 285ish
$post_ID = wp_insert_post( $post );

Add this right BEFORE that line:

if(!isset($post['post_content'])){
  $display = FrmProDisplay::getAll("form_id={$form_id} and show_count in ('single', 'dynamic', 'calendar')", '', ' LIMIT 1' );
  if($display){
    $post['post_content'] = apply_filters('frm_content', $display->dyncontent, $form_id, $entry_id);
  }
}

This version isn't tested. If it doesn't work you may just need to wait until the beta version is ready for the next release which is probably a month or so out.

I did all that and I do not see any changes (other than custom displays beging automatically created for each form), unless I am looking in the wrong place. I am not sure I know how to utilize custom displays properly. This is the only thing I have not been able to figure out...everything else has worked great!

There was a typo in the code above (had dyn_content instead of dyncontent). Please try the updated code above.

Topic closed.