Support

Account

Home Forums Backend Issues (wp-admin) Add field group to a custom plugin page

Solved

Add field group to a custom plugin page

  • Hi,

    I’m creating a little internal plugin for exporting orders (for a Woocommerce webshop). There will be 2 admin pages:

    EXPORTER:
    — Orders overview
    — Export rules

    The ‘export rules’ is list of custom rules. For example: If the order contains ‘X’ items of product ‘Y’ then use package-id ‘Z’. New rules are added each week, so I was planning on using the repeater field.

    The ‘orders overview’ is a page used to show orders grouped per day. The rules added on the ‘export rules ‘page are used to generate a custom csv-file.

    I’m pretty sure I can use ACF to make this possible, but I’m not sure how. I have 2 questions:
    – How can I add my field group to my custom admin page ‘Export rules’?
    – How can I load this fields into ‘orders overview’? (Since there is no post-id I can use)

    Thx in advance!

  • You can’t add ACF field groups to custom admin pages unless those pages are created with ACF Options Page addition. I would suggest that you get ACF5 Pro unless you don’t already have it. Then you can create an options page with ACF in the same location as where you want to put your custom admin page. Then you can put your fields there and you can get the values using get_field('field_name', 'option');

  • Solved 🙂

    I used options pages in the past, but I didn’t know I could add a ACF options page as a child of an existing admin page. This solves it.

    thx!

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

You must be logged in to reply to this topic.