Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?

Allowing user to control code is explicitly unsafe operation. As you note the purpose of sanitization is pretty much to not let user slip in anything executable and/or with malicious intent. To “sanitize” executable code you would need programmatic understanding of it (code parser) and criteria engine to distinguish what is safe and what is … Read more

Default header image does not display

You should register the default headers using register_defaults_headers – e.g. register_default_headers( array( ‘default-image’ => array( ‘url’ => get_stylesheet_directory_uri() . ‘/assets/img/default-header.jpg’, ‘thumbnail_url’ => get_stylesheet_directory_uri() . ‘/assets/img/default-header.jpg’, ‘description’ => __( ‘Default Header Image’, ‘textdomain’ ) ), ) ); See the codex entry for more info on the function – https://codex.wordpress.org/Function_Reference/register_default_headers. The Codex isn’t clear, but this function … Read more

Theme check: Missing a text-domain

Let us look at the relevant line. I am reformatting it to easier understand what is going on: printf( _n(‘1 comment’, ‘%1$s comments’, get_comments_number() ), number_format_i18n( get_comments_number() ), ‘text-domain’ ); So what you are doing is calling printf with three parameters, each one now being on a separate line now as I formatted it. But … Read more