Support

Account

Forum Replies Created

  • Hey John. Thanks for the reply. Unfortunately the front-end form that I have created is set for “new_post” so “new_post” is sent in that value. What I need is the post_id of the page where the form is shown on the front end. OR I need a way to manipulate the Ajax query to add that value to the string so I can access it. The only way I’ve gotten this to work is with a SESSION variable which is messy. This is a password protected project management application that I’m building so that may be an OK solution but it’s not idea. If there was any other way to get this to work I’d love to hear suggestions.

  • I’m actually trying to do the same thing and having the same problem where no results show up. Did you end up figuring this out? Not sure what I’m doing wrong.

    as you can see. I’ve tried a few different ways and none seem to work. the field is set to show “documents” post type and I’m trying to filter by the documents custom field “rfi_project” and if it matches the current project.

    // filter RFI Drawing Reference for only this project
    function tmc_rfi_drawings_for_project( $args, $field, $post_id ) {
        $meta_query = array();
        $meta_query[] = array(
            'key' => 'rfi_project',
            'value' => get_the_ID()
        );
        $args['meta_query'] = $meta_query;
        //$args['meta_key'] = "rfi_project";
        //$args['meta_value'] = $post_id;
        return $args;
    }
    add_filter('acf/fields/post_object/query/key=field_59d435129094f', 'tmc_rfi_drawings_for_project', 10, 3);
    
Viewing 2 posts - 1 through 2 (of 2 total)