Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
/** * Customizer: Add Controls: Basic * * This file demonstrates how to add basic core controls to the Customizer. * * The Customizer API includes basic controls for the following control types: * - basic: checkbox * - basic: dropdown pages * - basic: radio * - basic: select * - basic: text * - basic: textarea * * WordPress 4.0 also introduced controls for the following specialized text input control types: * - text: email * - text: number * - text: password (not included here) * - text: search (not included here) * - text: tel * - text: url * * @package code-examples * @copyright Copyright (c) 2015, WordPress Theme Review Team * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer) */ /** * Theme Options Customizer Implementation. * * Implement the Theme Customizer for Theme Settings. * * @link http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-themes/ * * @param WP_Customize_Manager $wp_customize Object that holds the customizer data. */ function theme_slug_register_customizer_controls_basic( $wp_customize ){ /** * Failsafe is safe */ if ( ! isset( $wp_customize ) ) { return; } /** * Basic Checkbox control. * * - Control: Basic: Checkbox * - Setting: Display Footer Credit Link * - Sanitization: checkbox * * Register the core "checkbox" control to be used to configure the Display Footer Credit Link setting. * * @uses $wp_customize->add_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/ * @link $wp_customize->add_control() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_control */ $wp_customize->add_control( // $id 'display_footer_credit_link', // $args array( 'settings' => 'display_footer_credit', 'section' => 'theme_slug_section_footer', 'type' => 'checkbox', 'label' => __( 'Display Footer Credit Link', 'theme-slug' ), 'description' => __( 'Should the Theme developer credit link be displayed in your site footer?', 'theme-slug' ), ) ); /** * Basic Drop-down Pages control. * * - Control: Basic: Dropdown Pages * - Setting: Call-To-Action Link * - Sanitization: dropdown_pages * * Register the core "dropdown-pages" control to be used to configure Call-To-Action Link setting. * * @uses $wp_customize->add_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/ * @link $wp_customize->add_control() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_control */ $wp_customize->add_control( // $id 'cta_link', // $args array( 'settings' => 'cta_link', 'section' => 'theme_slug_section_frontpage', 'type' => 'dropdown-pages', 'label' => __( 'Call-To-Action Link', 'theme-slug' ), 'description' => __( 'Select the page to link to the Call-To-Action button on the front page.', 'theme-slug' ), ) ); /** * Basic Radio Button control. * * - Control: Basic: Radio * - Setting: Menu Position * - Sanitization: select * * Register the core "radio" control to be used to configure the Menu Position setting. * * @uses $wp_customize->add_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/ * @link $wp_customize->add_control() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_control */ $wp_customize->add_control( // $id 'menu_position', // $args array( 'settings' => 'menu_position', 'section' => 'theme_slug_section_header', 'type' => 'radio', 'label' => __( 'Menu Position', 'theme-slug' ), 'description' => __( 'Display the main navigation menu above or below the header image?', 'theme-slug' ), 'choices' => array( 'above' => __( 'Above', 'theme-slug' ), 'below' => __( 'Below', 'theme-slug' ) ) ) ); /** * Basic Select control. * * - Control: Basic: Select * - Setting: Color Scheme * - Sanitization: select * * Register the core "select" control to be used to configure the Color Scheme setting. * * @uses $wp_customize->add_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/ * @link $wp_customize->add_control() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_control */ $wp_customize->add_control( // $id 'color_scheme', // $args array( 'settings' => 'color_scheme', 'section' => 'theme_slug_section_colors', 'type' => 'select', 'label' => __( 'Color Scheme', 'theme-slug' ), 'description' => __( 'Select the color scheme to be used for your site.', 'theme-slug' ), 'choices' => array( 'blue' => __( 'Blue', 'theme-slug' ), 'red' => __( 'Red', 'theme-slug' ), 'green' => __( 'Green', 'theme-slug' ) ) ) ); /** * Basic Text control. * * - Control: Basic: Text * - Setting: Footer Copyright Text * - Sanitization: html * * Register the core "text" control to be used to configure the Footer Copyright Text setting. * * @uses $wp_customize->add_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/ * @link $wp_customize->add_control() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_control */ $wp_customize->add_control( // $id 'footer_copyright_text', // $args array( 'settings' => 'footer_copyright_text', 'section' => 'theme_slug_section_footer', 'type' => 'text', 'label' => __( 'Footer Copyright Text', 'theme-slug' ), 'description' => __( 'Copyright or other text to be displayed in the site footer. HTML allowed.', 'theme-slug' ) ) ); /** * Basic Textarea control. * * - Control: Basic: Textarea * - Setting: Custom CSS * - Sanitization: css * * Register the core "textarea" control to be used to configure the Custom CSS setting. * * @uses $wp_customize->add_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/ * @link $wp_customize->add_control() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_control */ $wp_customize->add_control( // $id 'custom_css', // $args array( 'settings' => 'custom_css', 'section' => 'theme_slug_section_css', 'type' => 'textarea', 'label' => __( 'Custom CSS', 'theme-slug' ), 'description' => __( 'Define custom CSS be used for your site. Do not enclose in script tags.', 'theme-slug' ), ) ); /** * Basic Email control. * * - Control: Text: Email * - Setting: Contact Email * - Sanitization: email * * Register the core "email" text control to be used to configure the Contact Email setting. * * @uses $wp_customize->add_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/ * @link $wp_customize->add_control() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_control */ $wp_customize->add_control( // $id 'contact_email', // $args array( 'settings' => 'contact_email', 'section' => 'theme_slug_section_footer', 'type' => 'email', 'label' => __( 'Contact Email', 'theme-slug' ), 'description' => __( 'Contact email address to be displayed in the site footer.', 'theme-slug' ) ) ); /** * Basic Number control. * * - Control: Text: Number * - Setting: Slide Count * - Sanitization: number_absint * * Register the core "number" text control to be used to configure the Slide Count setting. * * @uses $wp_customize->add_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/ * @link $wp_customize->add_control() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_control */ $wp_customize->add_control( // $id 'slide_count', // $args array( 'settings' => 'slide_count', 'section' => 'theme_slug_section_frontpage', 'type' => 'number', 'label' => __( 'Slide Count', 'theme-slug' ), 'description' => __( 'Set the number of sticky posts to display in the slider.', 'theme-slug' ) ) ); /** * Basic Telephone control. * * - Control: Text: Tel * - Setting: Contact Telephone * - Sanitization: number_range * * Register the core "tel" text control to be used to configure the Contact Telephone setting. * * A valid telephone number is either 10 or 12 digits, so the control is passed attributes * for min 10 and max 12, with step = 2. * * @uses $wp_customize->add_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/ * @link $wp_customize->add_control() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_control */ $wp_customize->add_control( // $id 'contact_telephone', // $args array( 'settings' => 'contact_telephone', 'section' => 'theme_slug_section_footer', 'type' => 'number', 'label' => __( 'Contact Telephone', 'theme-slug' ), 'description' => __( 'Contact phone number to be displayed in the site footer. Numbers only.', 'theme-slug' ), 'input_attrs' => array( 'min' => 10, 'max' => 12, 'step' => 2 ) ) ); /** * Basic URL control. * * - Control: Text: URL * - Setting: Contact Link * - Sanitization: url * * Register the core "url" text control to be used to configure the Contact Link setting. * * @uses $wp_customize->add_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/ * @link $wp_customize->add_control() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_control */ $wp_customize->add_control( // $id 'contact_link', // $args array( 'settings' => 'contact_link', 'section' => 'theme_slug_section_footer', 'type' => 'url', 'label' => __( 'Contact Link', 'theme-slug' ), 'description' => __( 'Contact link URL to be displayed in the site footer.', 'theme-slug' ) ) ); } // Settings API options initilization and validation. add_action( 'customize_register', 'theme_slug_register_customizer_controls_basic' );
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
⭐⭐ FREE BTC GUIDE ✅ Working ⭐⭐
JavaScript | 1 min ago | 0.67 KB
🎯🎯 +50,000$ in 1 month⭐ 🎯🎯
JavaScript | 2 min ago | 0.67 KB
⭐⭐ INSTANT MONEY EXPLOIT ⭐⭐ ✅
JavaScript | 5 min ago | 0.67 KB
⚡ Earn 8,000$ Monthly Leaked Guide 🎯⭐
JavaScript | 7 min ago | 0.67 KB
⭐⭐ Crypto Swap Glitch ✅ Easy money ⭐⭐
JavaScript | 9 min ago | 0.67 KB
💎 2OOO$ 15 MIN INSANE METHOD 💵🚨 ✅✅
JavaScript | 12 min ago | 0.67 KB
💎💎💎 EXPLOIT 2,500$ IN 10 MINUTES
JavaScript | 13 min ago | 0.67 KB
✅ FREE 2,000$ FROM SWAPZONE ✅
JavaScript | 17 min ago | 0.67 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!