-
Notifications
You must be signed in to change notification settings - Fork 8
Checkbox
Radoslav Georgiev edited this page Oct 21, 2018
·
2 revisions
The checkbox field in Ultimate Fields displays an HTML checkbox field. You can enable the usage of custom CSS in order to stylize it.
You can optionally enter text, which will be displayed next to the checkbox.
In PHP use the set_text( $text )
method to do it.
Field::create( 'checkbox', 'show_intro' )->set_text( 'Show' )
You can "Enchance the field with CSS" for the checkbox field. This will add a toggle-like button with an obvious on-off indicator.
In PHP you can do this through the fancy
method:
Field::create( 'checkbox', 'fancy_checkbox' )->fancy()
The value, which Ultimate FIelds returns for a checkbox field is always boolean, which means that you can use it for conditional statements without any additional checks.
<?php if( get_value( 'show_intro' ) ): ?>
<div class="intro">
<!-- Intro content here -->
</div>
<?php endif; ?>
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