Support

Account

Forum Replies Created

  • Thanks Hude2 – that is a good suggestion. I’ll give that a shot, but at least right now I have it working with the fields hardcoded into the code.

  • Hi Hube2 – Thanks again for answering my post.

    Unfortunately the issue is that I need the user to be able to edit their submitted post before any admin has the chance to come in click Save Draft, etc. So with that in mind, I have to be able to get the checkbox data out of ACF and back into GF so the user can edit checkboxes.

    Now I can do this just fine if I hard code the field names into the php, but what I would like to do is use the get_field_objects() to test if an object is a checkbox, and if it is, get the name of the field so it can be mapped to the corresponding GF field and then update the data so the user can edit.

    I do understand your explanation above, so, is there a way to trigger the Save Draft (I ask because I’ve not found the right hook yet) so that I can trigger that in the final GF hook. Basically, click Save Draft via php. This might not be possible since the Save Draft is a form that updates the post and post_meta, but hopefully there is a way.

    Otherwise, yes, I could use get_post_meta() but then I’m counting on those meta field names to tell me what type of field the meta_field is. But maybe I just need to make another meta_field that maps everything out. Which gets back to my suggestion for a plugin to make these mappings. Seems like a fun project, but not in line with what I’m working on now. Guess I’ll just hardcode the field names in for the time being.

    Thanks,

  • Hi Hube2 – that is a good suggestion but I don’t think it is the issue. The data is being exploded and then serialized, so it looks like this using a var_dump | s:44:”a:2:{i:0;s:8:”Choice A”;i:1;s:8:”Choice B”;}”;

    Thankfully we can get around using multi-select with just multiple checkboxes. But I would like to know the solution. It seems that there is a plugin in the making here, GF+Custom Post Type to ACF.

  • Hi agustinum –

    Depending on what you are doing, you could use a template for a page, or a single for a post, or archive for archives, etc. You just have to make sure to use the right structure hook ( http://genesistutorials.com/visual-hook-guide/ ) and then use either the_field() or echo get_field() to show off you data.

    You can also just put something in your functions file like
    add_action(‘genesis_after_header’,’my_function_name’);
    function my_function_name()
    {
    if(is_page(‘home’) :
    the_field(‘some_field_name’);
    endif;
    }

Viewing 5 posts - 26 through 30 (of 30 total)