Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter razor89

    (@razor89)

    Hi Thank you for the answer.

    Can you tell me where I need to add this code?

    Thread Starter razor89

    (@razor89)

    Hi @doekenorg

    all is good now and the data filtered based on post id now ??

    Thank you so much, and I really appreciate it for your help

    Btw I changed the code with this below:

    `/**
    * Hook that filters gravity export results for the current user.
    */
    add_filter( ‘gfexcel_output_search_criteria’, function ( array $search_criteria ) {
    $ids = get_posts( [
    ‘author’ => get_current_user_id(),
    ‘fields’ => ‘ids’, // We’re only interested in the id’s of these pages / posts
    ‘status’ => ‘publish’, // only check for published pages
    ‘post_type’ => ‘custom_post’, //I change this with my custom post type
    ‘numberposts’ => 1, // all results
    ] );

    // filter entries on post id
    $search_criteria[‘field_filters’][] = [
    ‘key’ => 4,
    ‘operator’ => ‘IN’,
    ‘value’ => $ids,
    ];

    return $search_criteria;
    } );

    Thread Starter razor89

    (@razor89)

    I’m sorry Doeke

    It didn’t work, I tried in several past days but still not work.

    But thank you so much for your help

    Thread Starter razor89

    (@razor89)

    Hello Doeke,
    sorry for late respond.

    1. What does your form do? Does it create posts?
    No, just to create the comment.
    so the form just use to create comment (to replace the default comment in WordPress)
    2. Do you have one form on multiple pages? And do you need the entries posted from that page?
    yes one form for multiple pages, just need to filter the entries based on each post and author of current post can download it.
    3. Can you give me step by step how a post is filled, what it contains, and what you would like as the result? Please leave no detail out.
    I’m using acf to create the post (one post per user). The result will be all entries based on current author of the post

    4. for sure will send it now

    Btw thank you so much for your support, really appreciate it.

    Thread Starter razor89

    (@razor89)

    or permalink it’s okay too

    Thread Starter razor89

    (@razor89)

    Sorry for late reply, thank you so much @doekenorg

    I tried the code, but looks like the result just the current user who fill the form.

    Maybe if nice if the result will be based on source url of the form.

    Thank you

    Thread Starter razor89

    (@razor89)

    I used one form for all custom post that created by users.

    If I don’t use filter, all data from all custom post from different author will be appear in the download file.

    So I just want if user download the file, the data will be based on their own post.

    Btw one user just can create 1 custom post.

    hopefully you know what I mean.

    Thank you so much for the help.

Viewing 7 replies - 1 through 7 (of 7 total)