Would love to know as well. Seems trivial and yet not addressed in any of the docs
Would love to know as well. I find the documentation for the REST API very lacking.
Hi @roger,
I encountered exactly the same issue, and i’ve written a logic which does the following:
-gets the current logged in user id
-in a loop, get the id’s of all posts by that user
-checks whether this specific post id is created / allowed to be edited by that user
-if allowed, nothing happens, and edit form is loaded /
-if not allowed, exit() and redirect the user
here’s my code, please place it in the page in which your frontend form resides, after your “get_header()” or “wp_head()” (can’t run the loop before that):
$user_ID = get_current_user_id();
$args = array(
'post_type' => 'your_post_type',
'posts_per_page' => -1,
'post_status' => 'any',
'author' => $user_ID
);
// The Query
$the_query = new WP_Query($args);
// The Loop
if ( $the_query->have_posts() ) {
$posts_by_user = array();
while ( $the_query->have_posts() ) {
$the_query->the_post();
$posts_by_user[] = get_the_ID();
}
} else {
//echo 'no posts found';
}
/* Restore original Post Data */
wp_reset_postdata();
// Check and redirect if needed
if (in_array($book_ID, $posts_by_user)) {
//echo "Post ID found in array";
} else {
$location = get_home_url();
$status = '302';
wp_redirect( $location, $status );
exit;
}
The code is checked and working, let me know if i can help in any other way.
I had a similar problem with ACF 4.2.2, then i updated to 4.3.0 and it was fixed. See here:
http://support.advancedcustomfields.com/forums/topic/authors-cant-upload-from-front-end-form/
After a few days, and i don’t know why, i was getting the same problem again. This time i found that TML’s Themed Profiles module is causing this (which is weird because it was activated before).
This thread solved my problem, and it might help you:
Hi,
I’m joining @Jaace request, “is there a way to make the file upload a drag-and-drop without triggering that modal popup so that itโs just on the page as a drag-and-drop uploader?”
Currently trying to integrate http://www.dropzonejs.com/ library with ACF. Has anyone had any experience with integrating dropzone or any other drag and drop js libraries with ACF?
Thanks and p.s thank you @elliot for this amazing plugin, really took my development to the next level. purchased all add-ons and will continue to do so ๐
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.