what is `get_section()` and how to use it?

by Latheesh V M Villa   Last Updated October 11, 2018 15:08 PM

i saw get_section() being used in WordPress. what is this function and how can i utilize it for theme development?

this is how it's being used :

c27()->get_section('table-block', [
            'icon' => $this->get_settings('the_icon'),
            'icon_style' => $this->get_settings('the_icon_style'),
            'title' => $this->get_settings('the_title'),
            'rows' => $this->get_settings('the_rows'),

Answers 1

If you check the code reference entry for get_section(), you can see its description:

Retrieve a customize section.

"customize" means the customizer, the theme handbook has a complete chapter for using the customizer API, and one paragraph explaining sections:

Sections are UI containers for Customizer controls. While you can add custom controls to the core sections, if you have more than a few options you may want to add one or more custom sections. Use the add_section method of the WP_Customize_Manager object to add a new section:

October 11, 2018 15:08 PM

Related Questions

Updated April 25, 2017 12:08 PM

Updated July 19, 2017 18:08 PM

Updated December 16, 2017 22:08 PM

Updated October 22, 2018 08:08 AM

Updated May 13, 2017 04:08 AM