Support

Account

Home Forums Backend Issues (wp-admin) Welcome Screen

Solved

Welcome Screen

  • I’m working on a welcome screen that can get users started in my multisite network and I’ve hit some questions. Any help on any of them would be great!

    1. Creating a new field group that uses some of the same exact fields from the options page, just to get the user selecting a few specific initial settings right away. Will that ever conflict in any way? Or do overlapping fields get along totally fine?

    2. Since the acf_form is in a welcome page, adding get_header and get_footer in there brings in my frontend’s header and styling. Am I ok with just wp_head and wp_footer?

    3. Because it’s a multisite installation, none of the field group IDs are consistent. Been trying to figure out how to get acf_form display the field group by its name.

    Thanks guys, any help would be huge!

  • Just found the admin_head action, so cross off #2!

  • 1) It depends on where the fields are. If the fields are on another options page then they will overwrite existing values. If your goal is to have 2 places to edit the same value then this will work, however, the field keys will be different and this can cause problems if the data in the fields is different. If your goal is to use the exact same field in multiple places then you’d be better off defining the field group using PHP.

    On the other hand if the values in some other place, for example on a post, then they can have the same name.

    Here are the rules, as it were. Any field name needs to be unique if they are located in the same place it will hold unique information. These are the places where you’ll run into trouble with 2 fields of the same name
    A) Any field on any options page, this would be the same place
    B) Two fields on the same Taxonomy/Term
    C) Two fields on the same Post

    2) You need to include the acf_form_head() call before the the wp_head() call. More of a WP thing then anything else, but you page must have a header. You’ll probably want to create a custom header and footer for this page if it does not look like the rest of your site. See the WP get_header() and get_footer() function for information on creating multiple header/footer files.

    3) If the field group is created on one site it will only be usable on that site. ACF 5 offers a Local JSON feature that will load the field groups into any site using the same theme. https://www.advancedcustomfields.com/resources/local-json/. You can also define multiple load points, so for instance you could have an “Admin” theme where you create field groups and then set a load point to load them into other themes on the installation.

  • John, thanks so much for taking the time to write all that out. Here’s some follow-up:

    1. That’s all really helpful information that I’ll copy down. But for this case, the goal is to have multiple places of editing the same value. So that if you were to save changes in one spot of the backend, it would display that change in the other spot in the backend. Whichever gets saved will just show up in the other. So you said “the field keys will be different and this can cause problems if the data in the fields is different” — can you expand on that?

    2. Awesome, that’s exactly what I needed

    3. I’ll look more into the Local JSON resource, thanks! But is there not a way to load a field group to an acf_form by its name or some other identifier other than ID? Right now I’m using the JSON to spread the custom fields themselves across the sites using that theme but when I created a new multisite site, the IDs were all different.

    Again, thanks for your help!

  • Lets say you created a field named ‘my_option’ in two different field groups. Each field is given a unique field key by ACF. This field key is used by ACF to determine what to do with the content that’s stored in the field. If the field in both groups have identical settings then it won’t be a problem. If they don’t then there will because when ACF saves a field it associated value with the field key of the last save. Since you plan to use the fields in the same way, just edit them in two places, then it won’t be a problem.

    Another thing when considering acf_form() is that you can specify the fields that you want to use rather than the field group, so there isn’t really a need to create another field group, just pick and choose the fields from the groups on options pages that you want them to edit. … completely forgot about this. I’m aware of all of the things it can do, I just haven’t had the need to use acf_form().

    There are several ways to use field groups on multiple sites in multisite, but like I said, there isn’t a way to create a field in the admin of one site and have it available on all sites. You either need to define the groups using PHP in a file that’s common to all sites or use the local_json feature to set up a load point and this setting needs to be common to all sites.

  • Super helpful.

    I’ll have to look into the individual fields then, sounds like the best option!

    Thanks again, John. Your epic avatar suits you.

  • Almost five years later and John’s still helping people. Way to go!

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

The topic ‘Welcome Screen’ is closed to new replies.