-
Notifications
You must be signed in to change notification settings - Fork 8
Section
Radoslav Georgiev edited this page Oct 21, 2018
·
2 revisions
Sections allow you to visually separate fields by their purpose.
They have no purpose data- & field-wise and no values will be saved for them.
Sections support:
- Title: The label of the section will be used for its title.
- Text: The description of the field will be displayed below the title of the section if entered.
- Icons: You can choose an icon, which will appear next to the title of the section.
- Backgrounds: There are multiple (fixed) options for the background of the section.
Here is how to create a basic section:
Field::create( 'section', 'basic_fields', 'Section title' )
->set_description( 'This description will be shown on a new row with normal font.' )
All of the settings, described below are marked clearly in the settings of the section in the interface.
You can use Dashicons to display an icon before the title of the section. Use the set_icon
method for that. It accepts a single parameter, which should be the icon CSS class.
Field::create( 'section', 'basic_fields' )
->set_icon( 'dashicons-calendar' )
You can use the set_color
method to change the background of the section.
Supported options are:
-
white
(default) blue
red
green
Field::create( 'section', 'basic_fields' )
->set_color( 'blue' )
Because of the fact that sections do not save any values, you cannot use them in the front-end.
Quick start
- Creating fields and using their values
- Installation
- Administration interface
- Using the PHP API
- Container Settings
Locations
- Overview & Usage
- Post Type
- Options Page
- Taxonomy
- Comment
- User
- Widget
- Shortcode
- Menu Item
- Attachment
- Customizer
Fields
- Fields
- Text
- Textarea
- WYSIWYG
- Password
- Checkbox
- Select
- Multiselect
- Image Select
- File
- Image
- Audio
- Video
- Gallery
- WP Object
- WP Objects
- Link
- Date
- DateTime
- Time
- Color
- Font
- Icon
- Map
- Embed
- Number
- Sidebar
- Complex
- Repeater
- Layout
- Section
- Tab
- Message
Features
- Adding fields to the Customizer
- Conditional Logic
- Front-End Forms
- Administration columns
- Import and Export
- REST API
- JSON Synchronization
- Yoast SEO
Ultimate Post Types
Functions and API
Tutorials