Skip to content

Instantly share code, notes, and snippets.

@fahidjavid
Last active June 11, 2017 16:24
Show Gist options
  • Select an option

  • Save fahidjavid/9f5d26db99ad94722f4fdffb32c38735 to your computer and use it in GitHub Desktop.

Select an option

Save fahidjavid/9f5d26db99ad94722f4fdffb32c38735 to your computer and use it in GitHub Desktop.
Translate with HTML tags using esc_html_* function inside. Example: copyright text
<?php
// example one
htmlspecialchars_decode( esc_html__( 'You have to setup the permalinks settings to
<strong>Post name</strong> from <code>Settings > Permalinks</code> page.', 'text-domain' ) );
// second example using whitelist (starred repo) function
whitelist_html( sprintf( __( "&copy; Copyright %s <a href='%s'>%s</a> - All Right Reserved.", 'text-domain' ), date( 'Y' ), get_site_url(), get_bloginfo( 'name' ) ), wp_kses_allowed_html() )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment