Support Forum

 
You must be logged in to post
Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

Can a form create a normal WP post?

Information/How to
No Tags
UserPost

8:06 am
October 11, 2010


Stelios

1

Hi,

I am looking for a plugin that will allow WP posting from the front page. I have seen the available free plugins, however they are not what I want.

I have tried the formidable free edition and it seems to do the job, only if it could create the posts in WP. Will the PRO version allow for this functionality?

If so, for a WP network, will the single installation be OK or I need the unlimited one?

Thanks

Stelios

11:36 am
October 11, 2010


Stelios

2

Hi again, I purchased the single installation and the form generates the posts, however regardless the used rights, the post is entered as draft. Is there any way to post from the form with the status=published?

Confused

8:24 am
October 12, 2010


Steph

3

What level of users will be creating the posts? Would it work to add a status field? You can try this out by adding a drop-down field and selecting status as the post field. The options shown in the drop-down are different depending on the user role.

If this won't work, let me know and I'll point you to the spot to change in the code to default the posts to published instead of draft.

10:03 am
October 12, 2010


Stelios

4

Thanks for the reply, I had already seen what you suggested in the priority support forum (regarding target post category & status) and tried it out. It works, however the post status selection is visible.

Is there any way to have something like the radio button selection with the preselected value "Submitted" and have it hidden? I tried several stuff like hidden field etc. but no luck.

Confused

8:37 pm
October 12, 2010


Steph

5

To hide it, you can add the field keys of the fields you want included into the form shortcode. For example:

[ formidable id=x fields="field1,field2,field3" ]

Where field1, field2, and field3 are the field IDs of the fields that you would like to show.

1:18 am
October 13, 2010


Stelios

6

Hi Steph,

Thanks for the guidance, I tried it, it does hide the post status field, however it does not set the preselected value of "Published". What am I missing?

I also get this warning since day 1, I think it does not affect the posting of the data, just thought you should know…

Warning: Invalid argument supplied for foreach() in /home/content/38/5487238/html/wp-content/plugins/formidable/pro/classes/models/FrmProEntry.php on line 154

Confused 

8:54 am
October 13, 2010


Steph

7

I've got a couple of code changes for you. The first will save the correct default value ('publish' instead of 'Published'). Be sure to set "Published" as the default value when editing your form.

Open formidable/classes/views/frm-forms/add_field.php

Change line 30-33 from

<?php foreach ($field['options'] as $opt){
    $selected = ($field['default_value'] == $opt)?(' selected="selected"'):(''); ?>
    <option value="<?php echo $opt ?>"<?php echo $selected ?>><?php echo $opt ?></option>
<?php } ?>

to:

<?php foreach ($field['options'] as $opt_key => $opt){
    $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);
    $selected = ($field['default_value'] == $field_val)?(' selected="selected"'):(''); ?>
    <option value="<?php echo $field_val ?>"<?php echo $selected ?>><?php echo $opt ?></option>
<?php } ?>

I am aware of that warning and have fixed it for the next release. You can correct this in your code by opening formidable/pro/classes/models/FrmProEntry.php and adding this at line 154:

if(isset($_POST['frm_wp_post_custom'])){

And this at line 162:

}

12:44 am
October 15, 2010


Stelios

8

Hi Steph,

It did work, however had to delete the status field and create it again. Also it works only with drop down select, not with radio buttons – but this is fine by me!

Regarding the warning, I don't have the file that you mentioned, I have FrmEntry.php. Shall I do the fix at the same location?

Thanks!

Cool

11:52 am
October 15, 2010


Steph

9

To fix that warning, be sure to look in the pro folder inside of formidable to find the correct file.

Information/How to
No Tags