Title: leanne63's Replies | WordPress.org

---

# leanne63

  [  ](https://wordpress.org/support/users/leanne63/)

 *   [Profile](https://wordpress.org/support/users/leanne63/)
 *   [Topics Started](https://wordpress.org/support/users/leanne63/topics/)
 *   [Replies Created](https://wordpress.org/support/users/leanne63/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/leanne63/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/leanne63/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/leanne63/engagements/)
 *   [Favorites](https://wordpress.org/support/users/leanne63/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to get count of settings set within a Customizer section?](https://wordpress.org/support/topic/how-to-get-count-of-settings-set-within-a-customizer-section/)
 *  Thread Starter [leanne63](https://wordpress.org/support/users/leanne63/)
 * (@leanne63)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/how-to-get-count-of-settings-set-within-a-customizer-section/#post-6653643)
 * To solve this, I did the following:
    - Changed my customize_register function so all of my custom settings’ ids were
      prefixed with their section’s id. (For example, I changed the ‘twitter_url’
      setting id to ‘social_media_twitter_url’. I changed the Facebook setting id
      from ‘facebook_url’ to ‘social_media_facebook_url’, and so on.).
    - Wrote a function that accepts a section id (such as ‘social_media’), then 
      searches the results of get_theme_mods(), and returns a new array with only
      the items that match the provided section id. (For example, get_section_mods(‘
      social_media’ ) returns array([‘social_media_twitter_url]=>’[http://twitter.com/…&#8217](http://twitter.com/…&#8217);[
      social_media_facebook_url]=>’[http://facebook.com/…&#8217](http://facebook.com/…&#8217);,
      and so on.)
 * For my purposes, I also coded the function to check for a value for the found
   ids. If a setting doesn’t have a value, the function doesn’t include it in the
   returned array.

Viewing 1 replies (of 1 total)