Support

Account

Home Forums ACF PRO Options Sub Page

Solved

Options Sub Page

  • I created an Options Page as a sub page of the CPT.

    Does ACF always load in WP-ADMIN so that I can use acf_form() to display a form on my options page?

  • I follow this thread because it also interests me 🙂

  • I don’t know if ACF is loaded on your options page. I do know that ACF is loaded on any location that you can select in the location settings for a field group.

    If the options page is created using ACF then yes, ACF is loaded. But then I’m not sure why your using ACF for the options page and not the field group.

    If you’re using some other method to create the options page, then I don’t know. The best way to answer this is to look in the html code of the generated page and see if the acf scripts are included.

  • So, I create a Sub Menu page using add_submenu_page() and ACF is not loaded for that page. Adding acf_form_head() manually fixed my problem.

  • // Add ACF form support for tscpl-pb-export submenu page
    function tscpl_add_acf_head() {
      if ( get_current_screen()['base'] == 'admin_page_tscpl-pb-export' ) {
        acf_form_head();
      }
    }
    add_action( 'get_header', 'tscpl_add_acf_head', 1 );
  • ACF cannot automatically add groups to pages created with add_submenu_page(). It can only add groups to it’s own options pages.

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

The topic ‘Options Sub Page’ is closed to new replies.