Skip to content

Instantly share code, notes, and snippets.

@seothemes
Created June 19, 2018 13:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save seothemes/8ce17aba2c0a821249ff5d3b62a1a117 to your computer and use it in GitHub Desktop.
Save seothemes/8ce17aba2c0a821249ff5d3b62a1a117 to your computer and use it in GitHub Desktop.
Outputs a list of widget area IDs.
<?php
// Do NOT include the opening php tag shown above. Copy the code shown below.
add_action( 'wp_footer', 'prefix_list_widget_areas' );
/**
* Outputs a list of widget area IDs.
*
* @since 1.0.0
*
* @return void
*/
function prefix_list_widget_areas() {
foreach ( $GLOBALS['wp_registered_sidebars'] as $sidebar ) {
echo $sidebar['id'] . '<br>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment