Home Forums Bug Reports Re-Order Field Groups & Turning Off Content Editor


Re-Order Field Groups & Turning Off Content Editor

  • I have been having problems lately with two items…

    1) Re-ordering fields groups so that they appear in a particular order when editing a page.

    I have one field group called “page banners” applied to all pages and another called “about intro” applied to just my about page.

    I want “page banners” to display first (order is set to 2) and “about intro” second (order is set to 20).

    Not matter what I do they are displaying in reverse order from what is desired and dictated by using the order number.

    2) The other issue I am having is that I want to turn the content editor off on certain pages. In the past I could do this by checking the box on a field group assigned specifically to that page only to turn off the content editor.

    The problem occurs when I have a scenario similar to above, one field group displayed globally across all pages, and another specific to just that page. In that scenario I cannot turn off the content editor unless I check off the box in both fields groups.

    That is fine except the undesired side effect is that on the pages I want to show the content editor it does not show.

    Any help is greatly appreciated.

  • For the first problem, the issue is most likely caused by WP saving the order of the field groups when a user saves a post. WP remembers the order that they’re displayed and shows them in that order every time it the user has edited a post before. There are two ways that I know of to correct this. The first is to drag the field groups into the order that you want them and the second is to go into the user meta table in the database and delete the entry that WP saves for the sort-able meta fields.

    As far as the second part, the hide on page check boxes only have an effect for the first field group that ACF includes on a page according to the sort order specified in the acf field groups. In this case it is the group “page banners” that’s going to control what is and is not shown on the editor page. At least that’s the way it’s supposed to work.

  • Hi John H:

    Thanks for the input.

    On #1 I understand what is happening but it still seems like the ACF plugin should override this default behavior, why else would there be an order feature? I used the drag method to correct it, but since I use Seamless (No Metabox) option, I had to switch to Standard (WP Metabox) first to correct the ordering.

    On #2 in this particular scenario I feel like this is a bug or design flaw. It should definitely cascade down and loop through the groups and if anything is checked it should apply the action.

    Especially since “page banners” group applies to all page, not just the one page where I want to turn off the content editor.

  • One of the things I know the developer doesn’t like doing is overriding default WP behaviors. I think he’s said in the past that it falls outside of what he wants ACF to do. I found some information about how this can be done, have not tried it though

    I guess I haven’t run into this problem because I rarely put groups above the content editor and when I do it is almost always because I’m going to disable the content editor. I generally set groups like page banners to a higher order and let them appear below the editor.

    I can mark this topic for the developer to take a look at if he has time

  • I respect the motivation to not over ride default WP Core features. I certainly appreciate your consideration for escalating the request.

    Meanwhile, I will look into the solution above. I do remember seeing that particular article when looking for an answer prior to posting here.

    I build several pages on my sites where I do not use the content editor so I want it turned off completely. However I need it available for those pages where I do need it.

    What I don’t want to do is place ACF fields below the content editor and have the content editor blank.

    Our preference is to have the ACF fields always appear in the editor in the order in which they will appear on front-end.

  • I wouldn’t say escalate, I just help out here on the forum mostly because the developer doesn’t have time to get here very much. All I can really do is assign it to him and post a note in the topic.

    I can understand wanting to have the fields in the same order that they show up on the front end of the site, would make easier for my clients to understand as well.

    If I had time I’d look into how make it happen with a filter of some kind, but right now I already have too many pots on the stove.

    If you look in the file /advanced-custom-fields-pro/forms/post.php on line 163 and file /advanced-custom-fields-pro/api/api-field-group.php on line 887 you can see where the styles that hide things are generated.

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

The topic ‘Re-Order Field Groups & Turning Off Content Editor’ is closed to new replies.