-
-
Save ControlledChaos/e91b091899788ecae82e316393548f45 to your computer and use it in GitHub Desktop.
Revisions
-
ajskelton renamed this gist
Oct 25, 2016 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,3 @@ $wp_customize->add_setting( 'themeslug_url_setting_id', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'themeslug_sanitize_url', -
ajskelton created this gist
Oct 25, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ /* * Custom URL Field */ $wp_customize->add_setting( 'themeslug_url_setting_id', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'themeslug_sanitize_url', ) ); $wp_customize->add_control( 'themeslug_url_setting_id', array( 'type' => 'url', 'section' => 'custom_section', // Add a default or your own section 'label' => __( 'Custom URL' ), 'description' => __( 'This is a custom url input.' ), 'input_attrs' => array( 'placeholder' => __( 'http://www.google.com' ), ), ) ); function themeslug_sanitize_url( $url ) { return esc_url_raw( $url ); }