I was able to update Types. Will the CRED update be rolled out or do I need to manually download and update?
Thanks,
Chuck
I updated CRED, but I'm still having issues. When I click the button it disappears from the page with no message displayed and nothing gets saved to the view.
Thanks,
Chuck
Okay, please apply the same patch to the updated CRED plugin. Let me know the results.
Not sure what you mean by patch, but I have everything set as it should be; still not getting the desired result.
No message shows after form is submitted.
In the view if I click to remove the post it creates an auto draft, screenshot: enlace oculto
Thanks,
Chuck
We released two errata posts yesterday about CRED showstopper issues that were introduced by the recent WordPress security update:
https://toolset.com/errata/cred-1-9-2-1-types-2-2-17-18-showstopper-when-using-cred-ajax-forms/
https://toolset.com/errata/cred-1-9-2-1-types-2-2-17-18-showstopper-when-using-cred-forms-with-recaptcha/
While there is a workaround for the reCAPTCHA issue, there is not currently a workaround for the AJAX form issue other than to disable AJAX submission for the form. Do either of these apply to this form?
Christian,
These do not apply. I am not using AJAX or reCAPTCHA for this form.
Thanks,
Chuck
Okay standby, I'll make a clone and take a closer look now.
In the view if I click to remove the post it creates an auto draft
The Add to Favorites CRED form is set to "Add new content" instead of "Edit existing content". This is why you're seeing new posts created. It should be set to "Edit existing content" since we're modifying the existing Motorcycle post.
- Add an "s" to the "favorite" type field name in the CRED form, it's required. I must have made a typo in the code I provided before:
[wpv-conditional if="( [types field='favorites'][/types] eq [wpv-current-user info='id'] )"]
- I don't see the JavaScript added to the CRED form's JS panel as I described here, was it deleted by mistake?
https://toolset.com/forums/topic/favorites-view/page/2/#post-581277
- Finally, the toolset_is_favorite shortcode needs to be updated to work with your custom database prefix:
add_shortcode( 'toolset_is_favorite', 'toolset_is_favorite_func');
function toolset_is_favorite_func($atts)
{
global $wpdb;
$post_id = $atts['id'];
$user_id = get_current_user_id();
$postmeta_table = $wpdb->prefix . 'postmeta';
$favorites = $wpdb->get_results( "SELECT * FROM $postmeta_table WHERE meta_key = 'wpcf-favorites' AND post_id = $post_id AND meta_value = $user_id LIMIT 1");
return sizeof($favorites) ? 1 : 0;
}
Please try these updates and let me know the results.
I made all those changes and we're getting close.
Screenshot before "removed from favorites" is clicked: enlace oculto
Screenshot after: enlace oculto
The button gets removed from certain posts.
Thanks,
Chuck
Can you retest that now that I have deleted the CRED Autodraft posts that were being created inadvertently before? Those were causing unexpected problems in the add/remove favorites workflow.
Christian,
I'm going to load a few more posts to the site this evening and test it out in depth. I'll let you know the result.
Thanks,
Chuck
One problem I'm noticing is the responsiveness of the "Remove form Favorites" button
Screenshot: enlace oculto
The class my theme uses is "x-btn x-global-btn"
I have inserted this in the CRED form and View, but am still having trouble getting the button to respond.
Does the class need to be inserted else where?
Thanks,
Chuck
If you mean the right column should stack underneath the thumbnail image, then that doesn't have anything to do with the button. It's because you're using a table to create this design. Tables are not responsive in that way. You could use a Bootstrap grid instead:
enlace oculto
Christian,
I have been following this thread closely as I am looking to implement the exact functionality. Where are you inserting this custom code to? Is it the JS window provided by toolset, or functions.php? If its the later, a search in my wordpress files shows multiple results, is one I should be using specifically? The themes function.php? Sorry..very new to this.
Thanks,
Tom
Ok, I was able to get some of this working by adding the jQuery to my theme's function.php file, in addition to the cred form conditional coding partnered with the jquery added to the cred JS frame.
I've ran into to one major problem, and hopefully I'm just overlooking something.
How do you allow the non-author to edit the post? When I'm logged in as the admin I'm able to see the cred form button on the posts that I have created under the admin account. But as soon as I log out, and sign in on pseudo user account, the button disappears for the same posts. I assume this is because I only allow the posts author to edit the post, and thus add their user id to the repeating post field?
The obvious solution to this is to allow everyone to edit posts, but that is just not an option for my site. I need a way to allow editing of a single field by everyone, any ideas? I'm thinking create a new post type that is just for favorites and can be edited by everyone, and somehow link it to my posts. I'm just sure how to create that link?
I hope I'm not de-railing this thread, my apologies if so, I just want this info together for others to take advantage of.
Thanks,
Tom