Skip Navigation

[Resolved] Would like contributor to be able to post

This support ticket is created 7 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Author
Posts
#430287

I am trying to: create a front-end form for normal post submission with CRED

I've followed your tutorial on how to create a membership site and it is absolutely great.
The new member - Business - has now the capability to create a post and I'd like to avoid sending the user to the wp admin area.

Is there a way to create a CRED front-end form for normal wordpress posts?

Something really basic like:
Title
Content
Featured image
WYSIWYG editor
Category

Thank you in advance!

Marco

#430361

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marco,

Thank you for contacting our support forum.

Yes this is actually possible all you need to do is to create the CRED form for a Post and then add the CRED form to a page.

Please let me know if this helps.
Thanks,
Shane

#430496

Hi Shane,

thank you for your swift reply, I've seen the tutorial to create a front-end submission CRED form and then add the form to a PAGE for general display.

What I'm asking is: is it possible to create a front-end submission CRED form and then add the relevant content in a standard WP post?

Looking forward to your reply,

Regards

Marco

#430499

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screen Shot 2016-08-30 at 4.12.28 PM.png

Hi Marco,

Yes this is possible. See screenshot

From the settings you should be able to select the default post type of wordpress.

Please let me know if this helps.
Thanks,
Shane

#430744

Hi Shane,

thank you for putting me on the right path!

There are a few bugs that need to be solved.
- I've enabled the Add Media button, however if I try to upload an image into the content, I get the "You don't have permission to attach files to this post" message
- Similar issue happens when trying to set a Featured Image to the post: "Featured image upload failed."

I suspect the problem has to do with the user permission level: I've created a Role called Business set at level 2, with only upload_files/Allows access to Administration Panel: Media (Add New) set to true.

Any suggestion?

Thanks in advance!

#430896

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marco,

Thank you for the insight.

The custom role, does it have Publish capabilities for Media ?

Could you provide me with a screenshot for the Media permissions for the custom role?

Thanks,
Shane

#430951
Access Control - Media settings.png
Access - Custom roles overview.png
Access - custom role permission detail.png

Hi Shane,

Thank you for your reply!
Hopefully these screenshot will help you to pinpoint the issue.
Crossing fingers 🙂

Regards,

Marco

#431361

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marco,

I noticed you are running older versions of our plugins.

We have recently released our new versions of our plugins that will help with access permissions.

I suggest performing this update as a few changes were made to our access plugin.

Thanks,
Shane

#431998

Hi Shane,

I've updated the toolset components as suggested.

- Featured image uploads fine, however is not rendered in front end
this is the relevant CRED code

[credform class='cred-form cred-keep-original']
<p>Dear Member, please note your post will be screened by our staff and published according to our policies.
<h3>Title</h3>[cred_field field='post_title' post='post' value='' urlparam='']
<h3>Content</h3>[cred_field field='post_content' post='post' value='' urlparam='']
<h3>Choose a category:</h3>
[cred_field field='category' display='checkbox']
<h3>Tags:</h3>
[cred_field field='post_tag']
<h3>Featured image:</h3>[cred_field field='_featured_image' value='' urlparam='']
[cred_field field='form_submit' value='Submit Post' urlparam='']
[/credform]

- Upload of image in the post body is still generating the same error.

Waiting to hear from you,

Marco

#432603

Hi Shane,

Any update on the issue?

Thank you,

Marco

#432725

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marco,

Could you check on the backend if the featured image was actually uploaded through the CRED form ?

Thanks,
Shane

#432835
feature media not appearing in post.png
media present in library.png

Hi Shane,

picture is present in the Media library and is linked to the correct post (second screenshot) but not visible yet even if logged as admin (first screenshot)

Keeping my fingers crossed,

Regards,

Marco

#433163

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marco,

So this is a bug that we are already aware of and we are working on a fix for this.

In the meantime we have a workaround that should resolve this issue for you.

Please add the following to your functions.php file

/**
 * Custom code to force add thumbnail meta
 * to add announcement CRED form post
 */
function force_thumbnail( $post_id, $form_data ) {
 
    if ( $form_data['id'] == 1564 && !empty( $_POST['_featured_image'] ) ) {
 
        $args = array(
            'numberposts'   => 1,
            'post_type'     => 'attachment',
            'post_parent'   => $post_id
        );
        $thumb = get_posts( $args );
 
        $meta_update = add_post_meta( $post_id, "_thumbnail_id", $thumb[0]->ID, true );
 
    }
}
add_action( 'cred_submit_complete', 'force_thumbnail', 10, 2 );

Replace the 1564 with the id of your cred form and this should resolve the issue for you.

Thanks,
Shane

#433334

Hi Shane,

Thank you for the fix: it solved the featured image issue.

The "Add media in post" bug still persists, any workaround for that?

Thank you!

Marco

#433339

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Marco,

Would you mind opening a fresh thread for this issue and marking this one as resolved?

It would help to streamline the forums for other users who are having similar issues with their featured images.

You have the option of assigning me that ticket so i'll be able to handle it 🙂

Thanks,
Shane

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.