Some php code:
1 2 3 4 5 6 7 8 9 10 11 12 |
if ( ! function_exists( 'sitepointbase_get_credits' ) ) { function sitepointbase_get_credits() { $output = ''; $output = sprintf( '<p>%1$s <a href="%2$s">%3$s</a></p>', esc_html__( 'Proudly powered by', 'sitepoint-base' ), esc_url( esc_html__( 'http://wordpress.org/', 'sitepoint-base' ) ), esc_html__( 'WordPress', 'sitepoint-base' ) ); return $output; } } |
What about TS?
1 2 3 4 5 6 7 8 9 10 |
class Greeter { constructor(public greeting: string) { } greet() { return "<h1>" + this.greeting + "</h1>"; } }; var greeter = new Greeter("Hello, world!"); document.body.innerHTML = greeter.greet(); |