Unable to sanitize in customizer and escape in theme without removing ability for user to use “< br >” to insert a line break

You should use the helping site of validation – https://codex.wordpress.org/Data_Validation I think in your context is wp_kses the right function. You can allow html tags. The function have a lot of possibilities to use it with custom requirements. A small example to fast usage: $allowed_html = array( ‘a’ => array( ‘href’ => array(), ‘title’ => … Read more

How to add custom control to a page?

Found a great tutorial to do this very thing: http://javatechig.com/wordpress/how-to-implement-color-picker-with-wordpress <?php // add the meta box function wdm_add_meta_box() { add_meta_box(‘wdm_sectionid’, ‘Post Background’, ‘wdm_meta_box_callback’, ‘post’); } add_action( ‘add_meta_boxes’, ‘wdm_add_meta_box’ ); // callback function that renders your meta-box on the admin pages function wdm_meta_box_callback( $post ) { wp_nonce_field( ‘wdm_meta_box’, ‘wdm_meta_box_nonce’ ); $color = get_post_meta( $post->ID, ‘post_bg’, true … Read more

custom post type – page template

What are your custom fields? As in, did you create custom fields using the built in way (under screen options > custom fields) or did you create custom fields in the theme customiser panel. You need to make sure that the template “employee-template.php” is calling the custom fields. There are different ways to get the … Read more