Hi I’m trying get sidebars list in acf-export.php my function is here

function acf_get_all_sidebars(){
    $sidebars = $GLOBALS['wp_registered_sidebars'];
    $sidebar_options = array();
    foreach ( $sidebars as $sidebar ){
       $sidebar_options[$sidebar['id']] = $sidebar['name'];
    return $sidebar_options;

This function is working on page.php or rw-metaboxes but it’s not working in acf. $GLOBALS[‘wp_registered_sidebars’] and $wp_registered_sidebars returning empty array. How can I fix this? Thank you!

Read more here: Get registered sidebars list in ACF


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: