PluginProbe
LoftLoader / trunk
LoftLoader vtrunk
trunk 1.0.0 1.0.1 1.0.2 2.0.0 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.3.3 All 34 releases
loftloader / inc / configs / customize-range.php

customize-range.php in LoftLoader trunk, at inc/configs/customize-range.php

34 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Load loftloader lite display range related functions
4 *
5 * @since version 2.0.0
6 */
7 add_action( 'customize_register', 'loftloader_customize_range', 20 );
8 function loftloader_customize_range( $wp_customize ) {
9 global $loftloader_default_settings;
10
11 $wp_customize->add_setting( new WP_Customize_Setting( $wp_customize, 'loftloader_show_range', array(
12 'default' => $loftloader_default_settings['loftloader_show_range'],
13 'transport' => 'refresh',
14 'type' => 'option',
15 'sanitize_callback' => 'loftloader_sanitize_choice'
16 ) ) );
17
18 $wp_customize->add_section( new LoftLoader_Customize_Section( $wp_customize, 'loftloader_range', array(
19 'title' => esc_html__( 'Display on', 'loftloader' ),
20 'description' => '',
21 'priority' => 20
22 ) ) );
23
24 $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'loftloader_show_range', array(
25 'type' => 'radio',
26 'label' => '',
27 'choices' => array(
28 'sitewide' => esc_html__( 'Sitewide', 'loftloader' ),
29 'homepage' => esc_html__( 'Homepage only', 'loftloader' )
30 ),
31 'section' => 'loftloader_range',
32 'settings' => 'loftloader_show_range'
33 ) ) );
34 }