Support

Account

Forum Replies Created

  • +1 for this. We use wpengine for 300+ client sites and we’re using AFC Pro on a good number of them. It’s been a pain point every month when doing updates in staging since the staging URL is different from the live URL, so we have to enter the license key in staging to update the plugin, and then again once we push the staging site live.

  • That’s looks great!

    My only suggestion would be checking for a false value (even though it’s the default if the setting is omitted) in api-template.php on lines 1386 – 1401 using something like this:

    
        if( !empty( $args['wrap_field_groups'] ) && $args['wrap_field_groups'] !== false  ){
            ...
    

    Otherwise passing a value of false would still cause the wrappers to be output.

  • I never heard back about it, and for this project I just hacked plugin core and disabled updating (not the best move, but it needed to be done).

    There is a “Wrapper Attributes” field now that lets you specify a class (among other things) in the ACF pro plugin, but I haven’t checked to see if it adds the class when using the acf_form() function, and it is only available to each input, not the whole group. I also haven’t checked to see if anything has been added to make each field group output uniquely ID’d either, so maybe something like what I suggested has been added and I just don’t know about it.

    I like your suggestions too, and think that there are quite a few features that could be added on this front. I feel like this is probably one of the less used abilities of the plugin though, so I can understand why it wouldn’t get frequent feature updates. If it was available on github I wouldn’t mind making updates like these and submitting pull requests but I’m using the pro plugin.

  • For your links issue, you could handle this easily with just a little extra php and a few more ACF fields.

    Create a “Select field to your form, and give it the options that you’d like, such as URL, Page, Email, and File.

    Next, you’ll create a text input for the URL, and at the bottom of the field options, select “Yes” for “Conditional Logic”. This will show a new section, and you can set this field to only show when the selected value of your drop down is equal to “URL” (it auto-populates the available choices for you).

    Do the same thing when creating a “Page Link” relational field, “File” content field, and another text field for the email (you can set this text field up to validate the input to make sure it’s an email), and set their conditional logic appropriately.

    Now when a user needs to add one of those to a page, they use the dropdown select field to select the type of link they’ll be adding, and the appropriate field will be shown to them. You could even do this inside of a repeated field so that they could add multiple links if that would work with your use-case.

    In your theme files where you need to display these links, you would check to see if any selection was made, then get the data from the proper field based on which selection was made and build the link.

    If you wanted to allow them to select a user, and get their email automatically for the field, you could use the “User” relational field type, and then in your template use the data returned to get the user’s email (I’m not sure offhand if this field returns an object or just the user id though, so you’d have to play around with it).

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