Support

Account

Forum Replies Created

  • I’m afraid I can’t find the exact code I used for my previous post. 🙁

    Additionally I’m not sure whether the method of doing this has changed between ACF4 and ACFPRO.

  • If I use acf_form to edit an existing post, the nonce validation doesn’t pass on the first submit, but works fine on subsequent submits. I lose all my changes and it returns to the edit form (acf_form). Does the nonce get calculated with a referer that needs to be the same as the page where acf_form is displayed?

    EDIT:

    I’m also running WP on Apache behind Nginx, which acts as a reverse proxy. Client IPs and such are forwarded correctly.

  • Right now I’ve got the following working:

    1. Read all field groups using acf_local()->get_field_groups().
    2. Filter out all that are not in options pages as per the location matching rules.
    3. Get fields for all groups that are matched using acf_get_local_fields( $fieldgroup_key ).
    4. Read group keys and field keys.
    5. Output HTML based on group and fields as in foreach ( $groups as $fields ) : foreach ( $fields as $field_key => $field_data ) : printf( ... ); endforeach; endforeach;
    6. Said outputted fields are sent using standard HTML form element to the same page template (action="").
    7. Validation, referers, nonces, etc.
    8. Use the POST data to read field keys and update the database values from sanitized $_POST using update_field( $field_key, $value, 'options' ).

    Currently this works fine for non-JS infused fields, such as selects, text fields and so on. I’m working on getting the color picker working, which in the end should use a hidden text field anyway.

    Is there a more correct way to do this or should I wrap this into a plugin of sorts?

  • Hello,

    Yes, the custom taxonomy is visible and usable on each custom post edit page. It can be queried just fine everywhere else on the site.

    Could this be a problem with custom capabilities assigned to my custom post type (nothing spectacular, just renames “edit_posts” to “edit_cpts” and so on)?

    EDIT:

    Read through the core plugin code and noticed this line of code in the function that populates the select choices (get_taxonomies_for_select in acf.php) for the taxonomy filter:

    if(!is_taxonomy_hierarchical($taxonomy)) continue;

    I have my taxonomy as non-hierarchical and this seems to be the problem. I can’t seem to remember any notice of this on the field’s documentation page?

    Luckily my taxonomy will work about the same even if it is not non-hierachical, but will there be an update to allow filtering with these taxonomies too?

  • I think WPAlchemy (a metabox handler library) allows custom metaboxes above the core sidebar metaboxes. Not certain how it achieves this though. Perhaps by directly manipulating the global metabox data array before outputting the metaboxes?

    JavaScript could make a feasible workaround too.

  • Hello.

    Any progress on this issue?

    I’m using CPT-onomies (http://wpdreamer.com/plugins/cpt-onomies/) to create CPT/taxonomy combinations and can’t seem to assing taxonomies to users with ACF. CTP-onomies are a big part of my current project.

    Do I need to resort to using a custom term save function with users for now?

    EDIT: it seems CPT-onomies uses its own system for handling taxonomies. it doens’t utilise the default taxonomy tables in the database, but saves them to meta data instead. Nevermind, will need to create my own system anyways it seems.

Viewing 6 posts - 1 through 6 (of 6 total)