Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( ! function_exists( 'themename_sanitize_my_input' ) ){
- /**
- * a tag, href and title attr only.
- * @param string $text
- * @return string
- */
- function themename_sanitize_my_input( $text = null ) {
- if( empty( $text ) ){
- return;
- }
- $text = wp_kses( $text , array(
- 'a' => array(
- 'href' => array(),
- 'title' => array()
- )
- ));
- return $text;
- }
- }
- // WP customizer.
- $wp_customize->add_setting( 'my-setting-id' , array(
- 'default' => '',
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'themename_sanitize_my_input'
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement