Support

Account

Home Forums Front-end Issues How to get all fields from options page in one call?

Helping

How to get all fields from options page in one call?

  • I have registered options page Settings and there I have created various fields. Is there a way we could fetch all data in one call, like we can do using post_get_meta($id)? I am measuring number of queries so I am trying to lower that number.

    Currently I use get_field(‘setting1’, ‘option’).

    if( function_exists(‘acf_add_options_page’) ) {

    acf_add_options_page(array(
    ‘page_title’ => ‘Settings’,
    ‘menu_title’ => ‘Settings’,
    ‘menu_slug’ => ‘settings’,
    ‘capability’ => ‘edit_posts’,
    ‘redirect’ => false
    ));

    }

  • To reduce the number of queries for options set the options page to “autoload” values.

    Values will need to be updated for this autoloading to take effect.

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

You must be logged in to reply to this topic.