Advertisement
Guest User

WP Customizer example 2

a guest
Mar 8th, 2016
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $wp_customize->add_section( 'your_section_name', array(
  2.   'title' => __( 'Section Name', 'textdomain' ),
  3.   'description' => __( 'Section Description', 'textdomain' )
  4. ) );
  5.  
  6. $wp_customize->add_setting( 'your_setting_name', array(
  7.   'default' => 'latest',
  8.   'sanitize_callback' => 'sanitize_text_field',
  9.   'transport' => 'postMessage',
  10. ) );
  11.  
  12. $wp_customize->add_control( 'your_setting_name', array(
  13.   'label' => __( 'Setting Name', 'textdomain' ),
  14.   'description' => __( 'Setting Description / Control Instructions', 'textdomain' ),
  15.   'section' => 'your_section_name',
  16.   'type' => 'radio',
  17.   'choices' => array(
  18.      'value1' => __( 'Label 1', 'textdomain' ),
  19.      'value2' => __( 'Label 2', 'textdomain' ),
  20.   ),
  21. ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement